PDA

View Full Version : /givemoney and /setmoney


Jaua10
12/07/2018, 08:08 AM
Guys im making a /givemonye cmd and /setmoney but now when i try to compile show me this just with my cmd /givemoney

CMD:givemoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [PlayerID / PartOfName] [Money]");

if(IsPlayerConnected(giveplayerid))
{
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have give player %s's $%d.",GetName(giveplayerid),money);//You have set %s's cash to an amount of $%d.
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
new ip[32], ipex[32];
new i_dateTime[2][3];
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerIp(giveplayerid, ipex, sizeof(ipex));
format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s (IP:%s) has paid $%d to %s (IP:%s)", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], GetName(playerid), ip, money, GetName(giveplayerid), ipex);
PayLog(string);
PlayerInfo[playerid][pCash] = money;

}
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use that command !");
}
return 1;
}

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1766) : error 017: undefined symbol "id"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


line 1766

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);

DerickClark
12/07/2018, 08:09 AM
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(giveplayerid), money);

Mike861
12/07/2018, 08:11 AM
Do you have a stock GetName anywhere in your script?If you don't then put this anywhere you want.
stock GetName(playerid)
{
new getthename[MAX_PLAYER_NAME];
GetPlayerName(playerid,getthename,sizeof(getthenam e));
return getthename;
}

DerickClark
12/07/2018, 08:12 AM
Do you have a stock GetName anywhere in your script?If you don't then put this anywhere you want.
stock GetName(playerid)
{
new getthename[MAX_PLAYER_NAME];
GetPlayerName(playerid,getthename,sizeof(getthenam e));
return getthename;
}

There are no problem with that.

Jaua10
12/07/2018, 08:25 AM
Do you have a stock GetName anywhere in your script?If you don't then put this anywhere you want.
stock GetName(playerid)
{
new getthename[MAX_PLAYER_NAME];
GetPlayerName(playerid,getthename,sizeof(getthenam e));
return getthename;
}

i already have it

DerickClark
12/07/2018, 08:32 AM
i already have it
Have you try my code?

Jaua10
12/07/2018, 08:57 AM
Have you try my code?

yes, it works but now im having 1 error and 1 warning with this:

CMD:setmoney ( playerid , params [] )
{
if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return NotAdmin(playerid);
new id , ammount;
if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , COLOR_CORRECTION , "Invalid player specified !" ) ;
if ( ammount < 0 || ammount > 900000000 ) return SendClientMessage ( playerid , -1 , "You can't set more than $900.000.000" ) ;
if ( GetPlayerMoney ( playerid ) < ammount ) return SendClientMessage ( playerid , -1 , "You cant give money more than you have." ) ;
if ( sscanf ( params , "ui" , id , ammount ) ) return SendClientMessage ( playerid , -1 , "USAGE : /setmoney [PlayerID / PartOfName] [Ammount]" ) ;
else
{
new IName [ MAX_PLAYER_NAME ] , PName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
GetPlayerName ( id , IName , MAX_PLAYER_NAME ) ;
GetPlayerName ( playerid , IName , MAX_PLAYER_NAME ) ;
format ( Str , 128 , "%s Has Given You %d" , IName , ammount ) ;
SendClientMessage ( id , COLOR_RED , Str ) ;
format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
SendClientMessage ( playerid , COLOR_GREEN , Str ) ;
GivePlayerMoney ( id , ammount ) ;
}
return 1;
}

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1788) : warning 213: tag mismatch
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1788) : error 017: undefined symbol "NotAdmin"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


line error

if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return NotAdmin(playerid);

Jaua10
12/07/2018, 08:59 AM
It's possible to make it more easy? like this i found on tutorial, but i havent seen the admin params

CMD:setmoney(playerid, params[])
{
new target;
new money;
if(sscanf(params, "ui", target, money)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setmoney [playerid] [amount]");
{
ResetPlayerMoney(target);
GivePlayerMoney(target, money);
return 1;
}
}

Verc
12/07/2018, 09:02 AM
It seems that you are copying the code from somewhere right?

Change NotAdmin to return 0; or SendClientMessage

DerickClark
12/07/2018, 09:06 AM
CMD:setmoney ( playerid , params [] )
{
if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return SendClientMessage (playerid , COLOR_CORRECTION , "You are not admin!" ) ;
new id , ammount;
if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , COLOR_CORRECTION , "Invalid player specified !" ) ;
if ( ammount < 0 || ammount > 900000000 ) return SendClientMessage ( playerid , -1 , "You can't set more than $900.000.000" ) ;
if ( GetPlayerMoney ( playerid ) < ammount ) return SendClientMessage ( playerid , -1 , "You cant give money more than you have." ) ;
if ( sscanf ( params , "ui" , id , ammount ) ) return SendClientMessage ( playerid , -1 , "USAGE : /setmoney [PlayerID / PartOfName] [Ammount]" ) ;
else
{
new IName [ MAX_PLAYER_NAME ] , PName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
GetPlayerName ( id , IName , MAX_PLAYER_NAME ) ;
GetPlayerName ( playerid , IName , MAX_PLAYER_NAME ) ;
format ( Str , 128 , "%s Has Given You %d" , IName , ammount ) ;
SendClientMessage ( id , COLOR_RED , Str ) ;
format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
SendClientMessage ( playerid , COLOR_GREEN , Str ) ;
GivePlayerMoney ( id , ammount ) ;
}
return 1;
}

Jaua10
12/07/2018, 09:22 AM
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1788) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Header size: 8064 bytes
Code size: 200740 bytes
Data size: 21068108 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:21293296 bytes

1 Warning.


CMD:givemoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [PlayerID / PartOfName] [Ammount]");

if(IsPlayerConnected(giveplayerid))
{
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have give player %s's $%d",GetName(giveplayerid),money);//You have set %s's cash to an amount of $%d.
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
new ip[32], ipex[32];
new i_dateTime[2][3];
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerIp(giveplayerid, ipex, sizeof(ipex));
format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s (IP:%s) has paid $%d to %s (IP:%s)", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], GetName(playerid), ip, money, GetName(giveplayerid), ipex);
PayLog(string);
PlayerInfo[playerid][pCash] = money;

}
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use that command !");
}
return 1;
}
CMD:setmoney ( playerid , params [] )
{
if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return SendClientMessage (playerid , COLOR_CORRECTION , "You are not authorized to use that command !" ) ;
new id , ammount;
if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , COLOR_CORRECTION , "Invalid player specified !" ) ;
if ( ammount < 0 || ammount > 900000000 ) return SendClientMessage ( playerid , COLOR_CORRECTION , "You can't set more than $900.000.000" ) ;
if ( GetPlayerMoney ( playerid ) < ammount ) return SendClientMessage ( playerid , COLOR_CORRECTION , "You cant give money more than you have." ) ;
if ( sscanf ( params , "ui" , id , ammount ) ) return SendClientMessage ( playerid , COLOR_WHITE , "USAGE : /setmoney [PlayerID / PartOfName] [Ammount]" ) ;
else
{
new IName [ MAX_PLAYER_NAME ] , PName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
GetPlayerName ( id , IName , MAX_PLAYER_NAME ) ;
GetPlayerName ( playerid , IName , MAX_PLAYER_NAME ) ;
format ( Str , 128 , "%s Has Given You %d" , IName , ammount ) ;
SendClientMessage ( id , COLOR_RED , Str ) ;
format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
SendClientMessage ( playerid , COLOR_GREEN , Str ) ;
GivePlayerMoney ( id , ammount ) ;
}
return 1;
}

line warning:

if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return SendClientMessage (playerid , COLOR_CORRECTION , "You are not authorized to use that command !" ) ;

now when i type /setmoney always show me "You cant give money more than you have." and im admin 1337, also when i type /givemoney ID -956566 (negative money ) show this dialog format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d", GetName(giveplayerid), money); , why happends that if the /givemoney its just for possitive money and not negative?

JasonRiggs
12/07/2018, 02:28 PM
The part of you can't set money to more than what you have, can be fixed with this code to the command Setmoney

CMD:setmoney ( playerid , params [] )
{
if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return SendClientMessage (playerid , COLOR_CORRECTION , "You are not authorized to use that command !" ) ;
new id , ammount;
if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , COLOR_CORRECTION , "Invalid player specified !" ) ;
if ( ammount < 0 || ammount > 900000000 ) return SendClientMessage ( playerid , COLOR_CORRECTION , "You can't set more than $900.000.000" ) ;
if ( GetPlayerMoney ( playerid ) < ammount && PlayerInfo[playerid][pAdmin] < 1337 ) return SendClientMessage ( playerid , COLOR_CORRECTION , "You cant give money more than you have." ) ;
if ( sscanf ( params , "ui" , id , ammount ) ) return SendClientMessage ( playerid , COLOR_WHITE , "USAGE : /setmoney [PlayerID / PartOfName] [Ammount]" ) ;
else
{
new IName [ MAX_PLAYER_NAME ] , PName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
GetPlayerName ( id , IName , MAX_PLAYER_NAME ) ;
GetPlayerName ( playerid , IName , MAX_PLAYER_NAME ) ;
format ( Str , 128 , "%s Has Given You %d" , IName , ammount ) ;
SendClientMessage ( id , COLOR_RED , Str ) ;
format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
SendClientMessage ( playerid , COLOR_GREEN , Str ) ;
GivePlayerMoney ( id , ammount ) ;
}
return 1;
}

The part of give money command can be fixed with this code for givemoney command..

CMD:givemoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [PlayerID / PartOfName] [Ammount]");

if(IsPlayerConnected(giveplayerid))
{
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have give player %s's $%d",GetName(giveplayerid),money);//You have set %s's cash to an amount of $%d.
SendClientMessage(playerid, COLOR_SUCCESS, string);
if(money < 0)
{
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has taken from you $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
else if(money > 0)
{
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
new ip[32], ipex[32];
new i_dateTime[2][3];
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerIp(giveplayerid, ipex, sizeof(ipex));
format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s (IP:%s) has paid $%d to %s (IP:%s)", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], GetName(playerid), ip, money, GetName(giveplayerid), ipex);
PayLog(string);
PlayerInfo[playerid][pCash] = money;

}
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use that command !");
}
return 1;
}

ItsRobinson
12/07/2018, 06:54 PM
If you're getting "Undefined symbol" errors, it's most likely because you don't have a function/variable declared.

In your case, you most likely don't have something like this anywhere.


stock NotAdmin(playerid)
{
//random code of what happens if a player isn't an admin.
}


As for this error (not sure if you fixed it or not):


format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);


It's because the players ID was saved to a variables called "giveplayerid" not "id", so you need to use GetName(giveplayerid)

Jaua10
13/07/2018, 03:58 PM
what's the correct form:

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);

or

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(giveplayerid), money);

I would like to dont happent this:

http://prntscr.com/k645y5

takes my money away from me. i just want this cmd to give money no takes out

Florin48
13/07/2018, 04:02 PM
do not put "-" in front of the number.

Jaua10
13/07/2018, 04:05 PM
what's the correct form:

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);

or

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(giveplayerid), money);

Florin48
13/07/2018, 04:07 PM
for which command?

DerickClark
13/07/2018, 04:07 PM
what's the correct form:

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);

or

format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(giveplayerid), money);

Copy and Pasting won't help your problems. Start off with a another gamemode. Cause You don't even know the basic coding yet.

Jaua10
13/07/2018, 04:10 PM
for which command?

CMD:givemoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [PlayerID / PartOfName] [Amount]");

if(IsPlayerConnected(giveplayerid))
{
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have give player %s's $%d",GetName(giveplayerid),money);//You have set %s's cash to an amount of $%d.
SendClientMessage(playerid, COLOR_SUCCESS, string);
//format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d", GetName(giveplayerid), money);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
new ip[32], ipex[32];
new i_dateTime[2][3];
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerIp(giveplayerid, ipex, sizeof(ipex));
format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s (IP:%s) has paid $%d to %s (IP:%s)\r", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], GetName(playerid), ip, money, GetName(giveplayerid), ipex);
PayLog(string);
PlayerInfo[playerid][pCash] = money;

}
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use that command !");
}
return 1;
}

DerickClark
13/07/2018, 04:18 PM
You are not defining "id". You already defining "giveplayerid".
BTW. Stop copy and pasting.

Jaua10
13/07/2018, 04:25 PM
Alright i got fixed the givmoney, but the problem is with the /setmoney:

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1868) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1868) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1868) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1871) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1874) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1875) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1882) : warning 209: function "cmd_setmoney" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
new target;
new money;
new string[128], string2[128], giveplayerid;
if(sscanf(params, "ui", target, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(target);
GivePlayerMoney(target, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
return 1;
}
}

DerickClark
13/07/2018, 04:35 PM
Alright i got fixed the givmoney, but the problem is with the /setmoney:

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1868) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1868) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1868) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1871) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1874) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1875) : error 017: undefined symbol "target"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1882) : warning 209: function "cmd_setmoney" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
new target;
new money;
new string[128], string2[128], giveplayerid;
if(sscanf(params, "ui", target, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(target);
GivePlayerMoney(target, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
return 1;
}
}

CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
new money;
new string[128], string2[128], giveplayerid;
if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
return 1;
}

Jaua10
13/07/2018, 04:41 PM
i know but still saying C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : error 017: undefined symbol "string"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : error 001: expected token: ";", but found "]"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

DerickClark
13/07/2018, 04:44 PM
i know but still saying C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : error 017: undefined symbol "string"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : error 001: expected token: ";", but found "]"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1886) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Whats on 1886?

Jaua10
13/07/2018, 04:47 PM
new string[128], string2[128], giveplayerid, money;

DerickClark
13/07/2018, 04:59 PM
new string2[128], giveplayerid, money;

Jaua10
13/07/2018, 05:03 PM
still bumps me the same error:

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : error 017: undefined symbol "string2"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : error 001: expected token: ";", but found "]"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 5)
new string2[128], giveplayerid, money;
//new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");

if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
return 1;
}

there are strings and string2

DerickClark
13/07/2018, 05:10 PM
still bumps me the same error:

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : error 017: undefined symbol "string2"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : error 001: expected token: ";", but found "]"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1863) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 5)
new string2[128], giveplayerid, money;
//new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");

if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
return 1;
}

there are strings and string2

CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))
{
new string[128], string2[128], giveplayerid, money;
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
return 1;
}

Jaua10
13/07/2018, 05:24 PM
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1903) : error 017: undefined symbol "giveplayerid"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1904) : error 017: undefined symbol "giveplayerid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))

DerickClark
13/07/2018, 05:29 PM
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1903) : error 017: undefined symbol "giveplayerid"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1904) : error 017: undefined symbol "giveplayerid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))
CMD:setmoney(playerid, params[])
{
new string[128], string2[128], giveplayerid, money;
if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if (PlayerInfo[playerid][pAdmin] >= 4)
if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
return 1;
}

Florin48
13/07/2018, 05:32 PM
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1903) : error 017: undefined symbol "giveplayerid"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(1904) : error 017: undefined symbol "giveplayerid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))


CMD:setmoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new money;
new string[128], string2[128], giveplayerid;
if(sscanf(params, "ui", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [PlayerID / PartOfName] [Amount]");
if(IsPlayerConnected(giveplayerid))
{
ResetPlayerMoney(giveplayerid);
GivePlayerMoney(giveplayerid, money);
format(string, sizeof(string), "You have set %s's cash to an amount of $%d",GetName(giveplayerid),money);
SendClientMessage(playerid, COLOR_SUCCESS, string);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has set your cash amount to $%d", GetName(giveplayerid), money);
SendClientMessage(playerid, COLOR_SUCCESS, string2);
}
}
return 1;
}

Jaua10
13/07/2018, 05:56 PM
thanks