if(strcmp(cmd, \"/rob\", true) == 0) { tmp = strtok(cmdtext, idx); if(gTeam[playerid] == TEAM_RENDOR || gTeam[playerid] == TEAM_ARMY) { SendClientMessage(playerid,COLOR_WHITE,\"Te rendõr vagy!\"); return 1; } if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_RED, \"Használat: /rob [iD]\"); return 1; } if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_RED, \"Használat: /rob [iD]\"); return 1; } if(strval(tmp) == playerid) { SendClientMessage(playerid, COLOR_RED, \"Nem tudod magad kirabolni!\"); return 1; } giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), \"[%d] nincen ilyen játékos!\", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } new rname[24]; new vname[24]; GetPlayerName(playerid,rname, 24); GetPlayerName(giveplayerid, vname, 24); if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 3) { format(string, sizeof(string), \"%s(%d) nincs elég közel!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, \"Te jármûben vagy!\"); return 1; } if(IsPlayerInAnyVehicle(giveplayerid)) { format(string, sizeof(string), \"%s(%d) jármûben van!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(GetPlayerMoney(giveplayerid) <= 100) { format(string, sizeof(string), \"%s(%d) nincs pénze!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(raboltal[playerid] == 0) { new pcash = random(GetPlayerMoney(giveplayerid)); format(string, sizeof(string), \"%s(%d) kirabolt FT%d %s(%d)(-tól(-tõl)\",rname,playerid,pcash,vname,giveplayerid); printf(\"%s\", string); GivePlayerMoney(playerid,pcash); GivePlayerMoney(giveplayerid, -pcash); SendClientMessage(giveplayerid, 0xA9A9A9AA, \"|_RABLÁS_|\"); format(string, sizeof(string), \"%s(%d) rabolt FT%d tõled!\", rname,playerid,pcash); SendClientMessage(giveplayerid, 0xD2691EAA, string); OldCash[giveplayerid] -=pcash; SendClientMessage(playerid, 0xA9A9A9AA, \"|_RABLÁS_SIKERES_|\"); format(string, sizeof(string), \"Te raboltál FT%d %s(%d)(-tól(-tõl)\", pcash,vname,giveplayerid); SendClientMessage(playerid, 0x00C7FFAA, string); format(string, sizeof(string), \"~w~Rabl€s: ~n~%s(%d)~n~FT%d\",rname,playerid,pcash); GameTextForPlayer(giveplayerid,string,5000,3); oscore = GetPlayerScore(playerid); SetPlayerScore(playerid, oscore +1); format(string, sizeof(string), \"~w~Sikeres Rabl€s: %s(%d)~n~FT%d\",vname,giveplayerid,pcash); GameTextForPlayer(playerid,string,5000,3); RobbedPlyRecent[playerid] =1; beenrobbedrecently[giveplayerid] =120; commitedcrimerecently[playerid] +=120; SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); } return 1;}
[ c o d e] Szótagot használd! [ / c o d e]
Igy
WebSite\" post=\"156320\" timestamp=\"1310543434\"]Tudoma hogyan kell de légyszives tényleg használd a Igy Dupla hozzászólás automatikusan összefûzve. ( 2011. július 13. - 09:54:24 )amugy Tessék Itt Van : [pawn]if(GetPVarInt(playerid, \"robcmd\") == 1) return SendClientMessage(playerid, COLOR_RED, \"Hiba: Csak Egyszer Rabolhatsz!\"); SetPVarInt(playerid, \"robcmd\", 1);[/pawn]Ha Segitettem Ne Félj Megnyomni a + t [/quote]Ezzel csak egyszer lehetne rabolni.Használd így: //Globális névtérbenew bool: bCanRob[ MAX_PLAYERS ];public Task_ResetRob( id ); //OnPlayerCommandTextif(strcmp(cmd, \"/rob\", true) == 0) { tmp = strtok(cmdtext, idx); if( !bCanRob[ playerid ] ) return SendClientMessage( playerid, 0xFF0000AA, \"Csak 2 percenként rabolhatsz!\" ); if(gTeam[playerid] == TEAM_RENDOR || gTeam[playerid] == TEAM_ARMY) { SendClientMessage(playerid,COLOR_WHITE,\"Te rendõr vagy!\"); return 1; } if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_RED, \"Használat: /rob [iD]\"); return 1; } if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_RED, \"Használat: /rob [iD]\"); return 1; } if(strval(tmp) == playerid) { SendClientMessage(playerid, COLOR_RED, \"Nem tudod magad kirabolni!\"); return 1; } giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), \"[%d] nincen ilyen játékos!\", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } new rname[24]; new vname[24]; GetPlayerName(playerid,rname, 24); GetPlayerName(giveplayerid, vname, 24); if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 3) { format(string, sizeof(string), \"%s(%d) nincs elég közel!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, \"Te jármûben vagy!\"); return 1; } if(IsPlayerInAnyVehicle(giveplayerid)) { format(string, sizeof(string), \"%s(%d) jármûben van!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(GetPlayerMoney(giveplayerid) <= 100) { format(string, sizeof(string), \"%s(%d) nincs pénze!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(raboltal[playerid] == 0) { bCanRob[ playerid ] = false; SetTimerEx( \"Task_ResetRob\", 60000 * 2, false, \"d\", playerid ); new pcash = random(GetPlayerMoney(giveplayerid)); format(string, sizeof(string), \"%s(%d) kirabolt FT%d %s(%d)(-tól(-tõl)\",rname,playerid,pcash,vname,giveplayerid); printf(\"%s\", string); GivePlayerMoney(playerid,pcash); GivePlayerMoney(giveplayerid, -pcash); SendClientMessage(giveplayerid, 0xA9A9A9AA, \"|_RABLÁS_|\"); format(string, sizeof(string), \"%s(%d) rabolt FT%d tõled!\", rname,playerid,pcash); SendClientMessage(giveplayerid, 0xD2691EAA, string); OldCash[giveplayerid] -=pcash; SendClientMessage(playerid, 0xA9A9A9AA, \"|_RABLÁS_SIKERES_|\"); format(string, sizeof(string), \"Te raboltál FT%d %s(%d)(-tól(-tõl)\", pcash,vname,giveplayerid); SendClientMessage(playerid, 0x00C7FFAA, string); format(string, sizeof(string), \"~w~Rabl€s: ~n~%s(%d)~n~FT%d\",rname,playerid,pcash); GameTextForPlayer(giveplayerid,string,5000,3); oscore = GetPlayerScore(playerid); SetPlayerScore(playerid, oscore +1); format(string, sizeof(string), \"~w~Sikeres Rabl€s: %s(%d)~n~FT%d\",vname,giveplayerid,pcash); GameTextForPlayer(playerid,string,5000,3); RobbedPlyRecent[playerid] =1; beenrobbedrecently[giveplayerid] =120; commitedcrimerecently[playerid] +=120; SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); } return 1;}//public Task_ResetRob( id ) { bCanRob[ id ] = true;}
//Globális névtérbenew bool: bCanRob[ MAX_PLAYERS ];public Task_ResetRob( id ); //OnPlayerCommandTextif(strcmp(cmd, \"/rob\", true) == 0) { tmp = strtok(cmdtext, idx); if( !bCanRob[ playerid ] ) return SendClientMessage( playerid, 0xFF0000AA, \"Csak 2 percenként rabolhatsz!\" ); if(gTeam[playerid] == TEAM_RENDOR || gTeam[playerid] == TEAM_ARMY) { SendClientMessage(playerid,COLOR_WHITE,\"Te rendõr vagy!\"); return 1; } if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_RED, \"Használat: /rob [iD]\"); return 1; } if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_RED, \"Használat: /rob [iD]\"); return 1; } if(strval(tmp) == playerid) { SendClientMessage(playerid, COLOR_RED, \"Nem tudod magad kirabolni!\"); return 1; } giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), \"[%d] nincen ilyen játékos!\", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } new rname[24]; new vname[24]; GetPlayerName(playerid,rname, 24); GetPlayerName(giveplayerid, vname, 24); if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 3) { format(string, sizeof(string), \"%s(%d) nincs elég közel!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, \"Te jármûben vagy!\"); return 1; } if(IsPlayerInAnyVehicle(giveplayerid)) { format(string, sizeof(string), \"%s(%d) jármûben van!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(GetPlayerMoney(giveplayerid) <= 100) { format(string, sizeof(string), \"%s(%d) nincs pénze!\",vname,giveplayerid); SendClientMessage(playerid, COLOR_RED, string); return 1; } if(raboltal[playerid] == 0) { bCanRob[ playerid ] = false; SetTimerEx( \"Task_ResetRob\", 60000 * 2, false, \"d\", playerid ); new pcash = random(GetPlayerMoney(giveplayerid)); format(string, sizeof(string), \"%s(%d) kirabolt FT%d %s(%d)(-tól(-tõl)\",rname,playerid,pcash,vname,giveplayerid); printf(\"%s\", string); GivePlayerMoney(playerid,pcash); GivePlayerMoney(giveplayerid, -pcash); SendClientMessage(giveplayerid, 0xA9A9A9AA, \"|_RABLÁS_|\"); format(string, sizeof(string), \"%s(%d) rabolt FT%d tõled!\", rname,playerid,pcash); SendClientMessage(giveplayerid, 0xD2691EAA, string); OldCash[giveplayerid] -=pcash; SendClientMessage(playerid, 0xA9A9A9AA, \"|_RABLÁS_SIKERES_|\"); format(string, sizeof(string), \"Te raboltál FT%d %s(%d)(-tól(-tõl)\", pcash,vname,giveplayerid); SendClientMessage(playerid, 0x00C7FFAA, string); format(string, sizeof(string), \"~w~Rabl€s: ~n~%s(%d)~n~FT%d\",rname,playerid,pcash); GameTextForPlayer(giveplayerid,string,5000,3); oscore = GetPlayerScore(playerid); SetPlayerScore(playerid, oscore +1); format(string, sizeof(string), \"~w~Sikeres Rabl€s: %s(%d)~n~FT%d\",vname,giveplayerid,pcash); GameTextForPlayer(playerid,string,5000,3); RobbedPlyRecent[playerid] =1; beenrobbedrecently[giveplayerid] =120; commitedcrimerecently[playerid] +=120; SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); } return 1;}//public Task_ResetRob( id ) { bCanRob[ id ] = true;}
if(GetPVarInt(playerid,\"pRob\")>GetTickCount()) return SendClientMessage( playerid, 0xFF0000AA, \"Csak 2 percenként rabolhatsz!\" );SetPVarInt(playerid,\"pRob\",GetTickCount()+120000);// többi dolog