Because not all players have DecPlayerHandCash And IncPlayerHandCash, so this reason is "not have public" Deleted inc and dec :p
and i posted my commands but always update and keep the latest update.....
I'm talking about players that have both functions implemented. (DecPlayerHandCash & IncPlayerHandCash)
I suggest you to give more details in the first post, or to make 2 versions: one for GUPS and one for standard scripts. (detailed too)
+
What happens if the victim player doesn't have 200$ ? It will still take + give that amount.
ok ok [pawn] else if(strcmp(cmd,"rob",true) == 0) {
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if(Wallet[plr] == 1) {
SendClientMessage(playerid,0xAA3333AA,"You not cant rob the same player again!");
}
if ( !strlen( tmp ) ) SendClientMessage( playerid, 0xFFFF00AA, "Write: /c rob [Nick/ID]" );
else{
if(Wallet[plr] == 0) {
new Float:XR, Float:YR, Float:ZR;
GetPlayerPos(playerid,XR,YR,ZR);
if(PlayerToPoint(3.0,plr,XR,YR,ZR)){
if ( GetPlayerMoney( plr ) > 199 ) {
format( szMsg, sizeof( szMsg ), "%s steal the wallet of %s", gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll( 0xFFFF00AA, szMsg );
format( szMsg, sizeof( szMsg ),"You steal $ 200 of the player %s",gPlayers[plr]);
SendClientMessage(playerid, 0xFFFF00AA, szMsg );
SetPlayerMoney(plr,GetPlayerMoney(plr) - 200);
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 200);
Wallet[plr] = 1;
}
if ( GetPlayerMoney( plr ) < 199 ){
SendClientMessage(playerid,0xFFFF00AA,"This player not have money to rob");
SetPlayerMarker(playerid,15);
Wallet[plr] = 0;
}
}
else SendClientMessage(playerid,0xAA3333AA,"Need to be closer for rob");
}
}
}
return 1;
}[/pawn]
is better now sseebbyy??