Help ... -
lonako45 - 30.04.2012
OK !!
I want .. am
I do /givemoney 0 1000000
But if I do /remove 0
The money player get remove !
I want if the admin give him 10$
so 10$ remove
if 1000000000000000000000
so 1000000000000000000000 remove...
help ?
this my command now
PHP код:
if(strcmp(tmp, "Remove", true) == 0 || strcmp(tmp, "R", true) == 0)
{
if(GetAdminLevel(playerid) < 1 && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < 1 && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playerid, White, "רמת הניהול שלך נמוכה");
if(activity == 0) return SendClientMessage(playerid,White,"אין פעילות מופעלת");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, yellow, "/Activity Remove [ID] :צורת השימוש");
id = strval(tmp);
SetPlayerMoney(id, RemoveAny);
format(string,sizeof(string),"ממנצח בפעילות ולכן הכסף שלו הוסר %s הסרת את השחקן",GetName(id));
SendClientMessage(playerid,0x48c14ff, string);
format(string,sizeof(string),"הסיר אותך ממנצח בפעילות ולכן כספך הוסר %s האדמין",GetName(playerid));
SendClientMessage(id,0x48c14ff, string);
return 1;
}
if(strcmp(tmp, "GiveMoney", true) == 0 || strcmp(tmp, "Gm", true) == 0)
{
if(GetAdminLevel(playerid) < 1 && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < 1 && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playerid, White, "רמת הניהול שלך נמוכה");
if(activity == 0) return SendClientMessage(playerid, White, "כדי לתת לשחקן פרס צריכה להיות פעילות מופעלת");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, yellow, "/Activity GiveMoney(Gm) [id] [Money] :צורת השימוש");
id = strval(tmp);
tmp1 = strtok(cmdtext, idx);
if(!strlen(tmp1)) return SendClientMessage(playerid, yellow, "/Activity GiveMoney [Money] :צורת השימוש");
any = strval(tmp1);
if(any < 1 || any > 150000) return SendClientMessage(playerid, White, "סכום הפרס חייב להיות בין 150000 - 1");
any = strval(tmp1);
GivePlayerMoney(id, any);
format(string, sizeof(string),"%d ניצח בפעילות וקיבל את הסכום %s השחקן", any, GetName(id));
SendClientMessageToAll(0x48c14ff, string);
return 1;
}
Re: Help ... -
[KHK]Khalid - 30.04.2012
This might work, you didn't explain it well even though.
You'll have to rewrite all the client messages!
pawn Код:
if(strcmp(tmp, "Remove", true) == 0 || strcmp(tmp, "R", true) == 0)
{
if(GetAdminLevel(playerid) < 1 && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < 1 && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playerid, White, "My PC doesn't read Russian (Rewrite)");
if(activity == 0) return SendClientMessage(playerid,White,"My PC doesn't read Russian (Rewrite)");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, yellow, "/Activity Remove [ID] :My PC doesn't read Russian (Rewrite)");
id = strval(tmp);
new Cash = GetPvarInt(id, "GivenMoney"); // NEW
GivePlayerMoney(id, -Cash); // NEW
format(string,sizeof(string),"????? ??????? ???? ???? ??? ???? %s ???? ?? ?????",GetName(id));
SendClientMessage(playerid,0x48c14ff, string);
format(string,sizeof(string),"???? ???? ????? ??????? ???? ???? ???? %s ??????",GetName(playerid));
SendClientMessage(id,0x48c14ff, string);
return 1;
}
if(strcmp(tmp, "GiveMoney", true) == 0 || strcmp(tmp, "Gm", true) == 0)
{
if(GetAdminLevel(playerid) < 1 && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < 1 && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playerid, White, "??? ?????? ??? ?????");
if(activity == 0) return SendClientMessage(playerid, White, "??? ??? ????? ??? ????? ????? ?????? ??????");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, yellow, "/Activity GiveMoney(Gm) [id] [Money] :???? ??????");
id = strval(tmp);
tmp1 = strtok(cmdtext, idx);
if(!strlen(tmp1)) return SendClientMessage(playerid, yellow, "/Activity GiveMoney [Money] :???? ??????");
any = strval(tmp1);
if(any < 1 || any > 150000) return SendClientMessage(playerid, White, "???? ???? ???? ????? ??? 150000 - 1");
any = strval(tmp1);
GivePlayerMoney(id, any);
SetPVarInt(playerid, "GivenMoney", any); // NEW
format(string, sizeof(string),"%d ???? ??????? ????? ?? ????? %s ?????", any, GetName(id));
SendClientMessageToAll(0x48c14ff, string);
return 1;
}
Re: Help ... -
lonako45 - 30.04.2012
Erorr
error 017: undefined symbol "GetPvarInt"
Help?
Re: Help ... -
lonako45 - 30.04.2012
HELP ??
Re: Help ... -
Jack_Rocker - 30.04.2012
Quote:
Originally Posted by lonako45
Erorr
error 017: undefined symbol "GetPvarInt"
Help?
|
It should be:
GetPVarInt
not:
GetPvarInt
Capitalization is always an important factor in PAWN
Re: Help ... -
[KHK]Khalid - 30.04.2012
Quote:
Originally Posted by lonako45
Erorr
error 017: undefined symbol "GetPvarInt"
Help?
|
Yea typo. GetPVarInt should be fine.
Re: Help ... -
lonako45 - 01.05.2012
local variable "Cash" shadows a variable at a preceding level
Re: Help ... -
TzAkS. - 01.05.2012
Make it Cash1,you have created Cash 2 times or more.