Pagina de start a forumului sa-mp.MyForum.ro sa-mp.MyForum.ro
Fa-ti si tu propriul forum, pe www.myforum.ro!
 
 FAQFAQ   CautareCautare   MembriMembri   GrupuriGrupuri   InregistrareInregistrare 
 ProfilProfil   Mesaje privateMesaje private   AutentificareAutentificare 

Useful Functions

 
Creaza un subiect nou   Raspunde la subiect    Pagina de start a forumului sa-mp.MyForum.ro -> .: Script Showroom :.
Subiectul anterior :: Subiectul urmator  
Autor Mesaj
Ninja
Administrator
Administrator


Data inscrierii: 11/Iun/2008
Mesaje: 2

MesajTrimis: 11/06/2008 09:42    Titlul subiectului: Useful Functions Raspunde cu citat (quote)

[quote author=Andre9977 link=topic=61574.msg408911#msg408911 date=1212682844]
PS: It's "Useful Functions", not "Usefull functions".

GivePlayerHealth(playerid, Float:health)
playerid - playerid, who we are giving health to
Float:health - amount of health we're giving

[pawn]
stock GivePlayerHealth(playerid, Float:health)
{
new Float:pHealth;
GetPlayerHealth(playerid, pHealth);
SetPlayerHealth(playerid, pHealth + health);
}[/pawn]

SetPlayerMoney(playerid, money)
playerid - playerid, who's money we're setting
money - amount of money what we're setting player's money to

[pawn]
stock SetPlayerMoney(playerid, money)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, money);
}[/pawn]

PlayerToPoint(Float:radi, playerid, X, Y, Z) (NOTE: not by me)
Float:radi - radius
playerid - player that we're checking
Float:x, Float:y, Float:z - The position we're checking player's length from

[pawn]stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}[/pawn]

StopMusic(playerid)
playerid - player that we're stopping the music for
[pawn]
stock StopMusic(playerid)
{
PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
}[/pawn]

IsStringAName(string[]) (NOTE: Not by me)
string[] - String we're checking for name
[pawn]
stock IsStringAName(string[])
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
new testname[MAX_PLAYER_NAME];
GetPlayerName(i, testname, sizeof(testname));
if(strcmp(testname, string, true, strlen(string)) == 0)
{
return 1;
}
}
}
return 0;
}[/pawn]
GetPlayerID(string[]) (NOTE: not by me)
string[] - the string, which contains a player name, which ID we're getting
[pawn]
stock GetPlayerID(string[])
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
new testname[MAX_PLAYER_NAME];
GetPlayerName(i, testname, sizeof(testname));
if(strcmp(testname, string, true, strlen(string)) == 0)
{
return i;
}
}
}
return INVALID_PLAYER_ID;
}[/pawn]
[/quote]
Sus
Vezi profilul utilizatorului Trimite mesaj privat
tcapital
Junior
Junior


Data inscrierii: 25/Iul/2012
Mesaje: 5
Localitate: Great Britain

MesajTrimis: 02/09/2012 21:01    Titlul subiectului: Raspunde cu citat (quote)

Ur friends! I finally found something useful on the Internet! Thank you guys for the useful information.
Sus
Vezi profilul utilizatorului Trimite mesaj privat
Afiseaza mesajele pentru a le previzualiza:   
Creaza un subiect nou   Raspunde la subiect    Pagina de start a forumului sa-mp.MyForum.ro -> .: Script Showroom :. Ora este GMT + 2 ore
Pagina 1 din 1

 
Mergi direct la:  
Nu puteti crea un subiect nou in acest forum
Nu puteti raspunde in subiectele acestui forum
Nu puteti modifica mesajele proprii din acest forum
Nu puteti sterge mesajele proprii din acest forum
Nu puteti vota in chestionarele din acest forum


Powered by phpBB © 2001, 2005 phpBB Group
Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro