No error- just dont work!
#1

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.

Код:
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;
}
Can I get some help please? Thanks. Come check out my server too! 78.159.102.45:6000 Thanks
Reply
#2

In-Game it does absolutely nothing? It looks like it would say
"USAGE: /detain [playerid] [seat id (1/2/3)]");"
Reply
#3

Well you see when i did example: "/detain 3 2" it would do nothing
Reply
#4

bump
Reply
#5

Код:
if(strcmp(cmd, "/detain", true) == 0 || strcmp(cmd, "/detain", true) == 0)
{
	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)]");
	new seat = strval(tmp);
	if(IsPlayerConnected(person)) {
		if(seat > 0 && seat <= 3) {
			if(IsPlayerInAnyVehicle(playerid)) {
				if(gTeam[playerid] == 2) {
					if(gTeam[person] != 2) {
						if(GetDistanceBetweenPlayers(playerid,person) < 15) {
							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(person);
							PutPlayerInVehicle(person, GetPlayerVehicleID(playerid), seat);
						}else SendClientMessage(playerid, COLOR_GREY, " You are too far from the suspect!");
					}else SendClientMessage(playerid, COLOR_GRAD2, " You cannot detain cops!");
				}else SendClientMessage(playerid, COLOR_GREY, " You are not a cop!");
			}else SendClientMessage(playerid, COLOR_GREY, " You're not in vehicle !");
		}else SendClientMessage(playerid, COLOR_GREY, " Seats 0-3 !!");
	}else SendClientMessage(playerid, COLOR_GREY, " That ID is not connected !!");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)