Questa piccola guida vi servirà per capire il funzionamento di queste funzioni,aggiunte dalla versione RC5 in poi..
(Consiglato l'uso della versione server RC7 Motivo: Nella versione RC5 c'è un bug)
Funzioni Principali:
Quote
GetPVarInt
SetPVarString
GetPVarString
SetPVarFloat
GetPVarFloat
DeletePVar
SetPVarInt:
Sintassi: SetPVarInt(playerid,variabilenome,valoredasettare);
Questa funzione setta nella variabile,un valore.
Esempio:
SetPVarInt(playerid,"we",2);
Il valore di "we" verrà settato a 2.
GetPVarInt:
Sintassi: GetPVarInt(playerid,variabile);
Non c'è molto da spiegare.. praticamente getta il valore messo in "varname"
Esempio:
printf("Valore di we: %d",GetPVarInt(playerid,"we"));
SetPVarString:
Sintassi: SetPVarString(playerid,variabile,valoredasettare);
Setta alla variabile una stringa.
Esempio:
new stringo[90]; format(stringo,90,"tuonome%s",nome); SetPVarString(playerid,"we",stringo);
GetPVarString:
Sintassi: GetPVarString(playerid,variabile,dovemettereilmessaggio,lunghezza);
Getta il valore del campo.
Esempio:
new msg[128]; GetPVarString(playerid,"msg",msg,128); printf("valore %s",msg);
SetPVarFloat:
Sintassi: SetPVarFloat(playerid,variabilenome,valore);
Setta un valore float.
Esempio:
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,x,y,z): SetPVarFloat(playerid,"x",x); SetPVarFloat(playerid,"y",y); SetPVarFloat(playerid,"z",z);
GetPVarFloat:
Sintassi: GetPVarFloat(playerid,variabile);
Getta il valore float che sta nella variabile.
Esempio:
new var[256]; format(var,256,"Ultimi Valori: %f %f %f",GetPVarFloat(playerid,"x"),GetPVarFloat(playerid,"y"),GetPVarFloat(playerid,"z")); SendClientMessage(playerid,RED,var);
DeletePVar:
Sintassi: DeletePVar(playerid,variabilenome);
Cancella la variabile.
Esempio:
DeletePVar(playerid,"ciao");
La variabile "ciao" verrà cancellata.
- by ReVo_