30.07.2009, 02:08
Okay, heres my detain command. I have it all scripted and no errors/warnign appear, but when i do /detain IG, it
doesnt do anything.
Can I get some help please? Thanks. Come check out my server too! 78.159.102.45:6000 Thanks
doesnt do anything.
Код:
if(strcmp(cmd, "/detain", true) == 0 || strcmp(cmd, "/detain", true) == 0) { new suspect; if(gTeam[playerid] == 2) { if(GetDistanceBetweenPlayers(playerid,suspect) < 15) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /detain [playerid] [seat id (1/2/3)]"); new person = strval(tmp); tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /detain [playerid] [seat id (1/2/3)]"); if(gTeam[suspect] == 2) return SendClientMessage(playerid, COLOR_GRAD2, " You cannot detain cops!"); new seat = strval(tmp); new Float:pos[6]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerPos(person, pos[3], pos[4], pos[5]); if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 && floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 && floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false; ClearAnimations(giveplayerid); PutPlayerInVehicle(person, GetPlayerVehicleID(playerid), seat); } else { SendClientMessage(playerid, COLOR_GREY, " You are too far from the suspect!"); } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a cop!"); } return 1; }