14.05.2009, 17:45
hej i realy need help i have my detain codes but some times i have to move it around in my script because when i type /detain after some times it says that im not close to my last car but if i put a space or something on the lines in my GM then it works agen if i delete the space on the lines it works agen its fucking enojing here is the codes i hope you can help me with it.
btw when i meen space i meen a space in the first line of the code there it says if(..... i do like a space on if so i jumps down one line it works and delete the space on the line it works to something is bugged help please.
btw when i meen space i meen a space in the first line of the code there it says if(..... i do like a space on if so i jumps down one line it works and delete the space on the line it works to something is bugged help please.
Код:
if(strcmp(cmd, "/detain", true) ==0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == 2 || IsACop(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !"); return 1; } if(IsPlayerConnected(giveplayerid)) { if (ProxDetectorS(8.0, playerid, giveplayerid)) { new carid = gLastCar[playerid]; tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [playerid/PartOfName] [seatid]"); giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [playerid/PartOfName] [seatid]"); new seat = strval(tmp); if(seat < 0 || seat > 3) { SendClientMessage(playerid, COLOR_GRAD1, "The seat ID cannot be above 3 or below 1."); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* You were detained by %s .", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* You detained %s .", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s grabs %s and throws him in his car.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(giveplayerid, "~r~BUSTED", 2500, 3); ClearAnimations(giveplayerid); TogglePlayerControllable(giveplayerid, 0); PutPlayerInVehicle(giveplayerid,carid,seat); PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 99999999; } else { SendClientMessage(playerid, COLOR_GREY, " You are not close to your last car"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !"); } }//not connected return 1; }