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 © 1997-2006, ITB CompuPhase 1 Error.
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(id), money);
format(string2 ,sizeof(string2),"Admin Notification: Administrator %s has given you $%d.", GetName(giveplayerid), money);
stock GetName(playerid) { new getthename[MAX_PLAYER_NAME]; GetPlayerName(playerid,getthename,sizeof(getthename)); return getthename; }
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(getthename)); return getthename; } |
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(getthename)); return getthename; } |
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 © 1997-2006, ITB CompuPhase 1 Error.
if ( !PlayerInfo[playerid][pAdmin] >= 4 ) return NotAdmin(playerid);
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; } }
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; }