Help ...
#1

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) == || strcmp(tmp"R"true) == 0)
        {
        if(
GetAdminLevel(playerid) < && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playeridWhite"רמת הניהול שלך נמוכה");
        if(
activity == 0) return SendClientMessage(playerid,White,"אין פעילות מופעלת");
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playeridyellow"/Activity Remove [ID] :צורת השימוש");
        
id strval(tmp);
        
SetPlayerMoney(idRemoveAny);
        
format(string,sizeof(string),"ממנצח בפעילות ולכן הכסף שלו הוסר %s הסרת את השחקן",GetName(id));
        
SendClientMessage(playerid,0x48c14ffstring);
        
format(string,sizeof(string),"הסיר אותך ממנצח בפעילות ולכן כספך הוסר %s האדמין",GetName(playerid));
        
SendClientMessage(id,0x48c14ffstring);
        return 
1;
        }
        
        if(
strcmp(tmp"GiveMoney"true) == || strcmp(tmp"Gm"true) == 0)
        {
        if(
GetAdminLevel(playerid) < && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playeridWhite"רמת הניהול שלך נמוכה");
        if(
activity == 0) return SendClientMessage(playeridWhite"כדי לתת לשחקן פרס צריכה להיות פעילות מופעלת");
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playeridyellow"/Activity GiveMoney(Gm) [id] [Money] :צורת השימוש");
        
id strval(tmp);
        
tmp1 strtok(cmdtextidx);
        if(!
strlen(tmp1)) return SendClientMessage(playeridyellow"/Activity GiveMoney [Money] :צורת השימוש");
        
any strval(tmp1);
        if(
any || any 150000)  return SendClientMessage(playeridWhite"סכום הפרס חייב להיות בין 150000 - 1");
        
any strval(tmp1);
        
GivePlayerMoney(idany);
        
format(stringsizeof(string),"%d ניצח בפעילות וקיבל את הסכום %s השחקן"anyGetName(id));
        
SendClientMessageToAll(0x48c14ffstring);
        return 
1;
        } 
Reply
#2

This might work, you didn't explain it well even though.
You'll have to rewrite all the client messages!

pawn Код:
// NEW == Line changed
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;
}
Reply
#3

Erorr
error 017: undefined symbol "GetPvarInt"
Help?
Reply
#4

HELP ??
Reply
#5

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
Reply
#6

Quote:
Originally Posted by lonako45
Посмотреть сообщение
Erorr
error 017: undefined symbol "GetPvarInt"
Help?
Yea typo. GetPVarInt should be fine.
Reply
#7

local variable "Cash" shadows a variable at a preceding level
Reply
#8

Make it Cash1,you have created Cash 2 times or more.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)