15.01.2014, 14:10
Hello
I need help when player do /handsup then officer can cuff him but i am getting error in pawn complier. Here's the code
I need help when player do /handsup then officer can cuff him but i am getting error in pawn complier. Here's the code
Код:
if(strcmp(cmd, "/cuff", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsACop(playerid) || IsASoldier(playerid) || IsASWAT(playerid) || IsAnAgent(playerid) || IsASenate(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SyntaxMessage(playerid, "/cuff [playerid/name]"); return 1; } if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, GREY, "Cannot use this while in a Car."); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(PlayerTied[giveplayerid] > 0) { SendClientMessage(playerid, GREY, " That player is tied up."); return 1; } if(PlayerCuffed[giveplayerid] > 1) { SendClientMessage(playerid, GREY, " That player is already cuffed."); return 1; } if(IsPlayerInAnyVehicle(giveplayerid)) { SendClientMessage(playerid, GREY, "Suspect is in a car, get him out first."); return 1; } if(PlayerCuffed[giveplayerid] == 1)|| GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP) { if(ProxDetectorS(8.0, playerid, giveplayerid)) { if(giveplayerid == playerid) { SendClientMessage(playerid, GREY, " You cannot Cuff yourself."); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); //format(string, sizeof(string), "* You were cuffed by Officer %s.", sendername); //SendClientMessage(giveplayerid, LIGHTBLUE, string); if(PlayerInfo[giveplayerid][pMask] == 1) { format(string, sizeof(string), "* You cuffed a Stranger."); SendClientMessage(playerid, LIGHTBLUE, string); format(string, sizeof(string), "* %s hand cuffs a Stranger, so he wont go anywhere.", PlayerName(playerid)); ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE); } else { format(string, sizeof(string), "* You cuffed %s.", giveplayer); SendClientMessage(playerid, LIGHTBLUE, string); format(string, sizeof(string), "* %s hand cuffs %s, so he wont go anywhere.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE); } GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3); // ----- // THIS PART HAS BEEN COMMENTED OUT OF THE SCRIPT ON // MAY 14, 2012 FOR THE NEW CUFFING SYSTEM.*/ new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x,y,z); PlayerPlaySound(playerid, 5201, x,y,z); TogglePlayerControllable(giveplayerid, 1); SendClientMessage(giveplayerid, LIGHTBLUE, "You've been cuffed by an officer of the law."); SendClientMessage(giveplayerid, LIGHTBLUE, "You aren't frozen, however, if you decide to run off, you'll be placed in admin jail."); SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED); SetPlayerAttachedObject(giveplayerid, 5, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000); // ------ ClearAnimations(giveplayerid); //ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0); //ApplyAnimation(giveplayerid,"ped","cower",1,1,0,0,0,0); PlayerCuffed[giveplayerid] = 2; PlayerTazed[giveplayerid] = 0; PlayerCuffedTime[giveplayerid] = 300; PlayerTazeTime[giveplayerid] = 0; } else { SendClientMessage(playerid, GREY, " That player is not near you."); return 1; } } else { SendClientMessage(playerid, GREY, " That player needs to be restrained first."); return 1; } } else { SendClientMessage(playerid, GREY, " That player is offline."); return 1; } } else { SendClientMessage(playerid, GREY, " You are not a member of the law enforcement."); } } return 1; }
Код:
G:\SAMP\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(93447) : error 029: invalid expression, assumed zero G:\SAMP\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(93447) : warning 215: expression has no effect G:\SAMP\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(93447) : error 001: expected token: ";", but found ")" G:\SAMP\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(93447) : error 029: invalid expression, assumed zero G:\SAMP\U-RP [ENG - 0.3x]\gamemodes\U-RP.pwn(93447) : fatal error 107: too many error messages on one line