[pawn]new Wallet[MAX_PLAYERS];[/pawn]
"Gups or Fc version"
[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 ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, 0xAA3333AA, "Error: Unknown Player" );
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)) {
format( szMsg, sizeof( szMsg ), "%s steal the wallet of %s", gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll( 0xFFFF00AA, szMsg );
IncPlayerHandCash(playerid,200);
DecPlayerHandCash(plr,200);
Wallet[plr] = 1;
SetPlayerMarker(playerid,15);
}
else SendClientMessage(playerid,0xAA3333AA,"Need to be closer for rob");
}
}
}
return 1;
}[/pawn]
[pawn]public OnPlayerDeath(playerid, killerid, reason, bodypart)
{
Wallet[playerid] = 0;[/pawn]
[pawn]public OnPlayerDisconnect(playerid, reason)
{
Wallet[playerid] = 0;[/pawn]
All scripts version
[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]