SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 26/04/2010, 05:19 AM   #1
chaosnz
Big Clucker
 
Join Date: Aug 2008
Posts: 139
Reputation: 0
Default Im stumped, can someone please tell me whats causing it..

Heres the code.
Quote:
if(strcmp(cmd, "/detain", true)==0)
{
if (gTeam[playerid] == TEAM_COP)
{
tmp = strtok(cmdtext, idx);

if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [ID]");
return 1;
}
new pid = strval(tmp);
if(GetDistanceBetweenPlayers(playerid,pid) > 5) return SendClientMessage(playerid, COLOR_LIME, "You need to be with in 5 feet of your suspect to detain.");
if (IsPlayerConnected(pid))
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(pid,vehicleid,3);
TogglePlayerControllable(playerid,0);
SendClientMessage(pid, COLOR_WHITE, "You have been detained by a Police Officer");
}
}
else return SendClientMessage(playerid, COLOR_LIME, "Only Police Officers can use this command.");
return 1;
}
if(strcmp(cmd, "/kidnap", true)==0)
{
if (gTeam[playerid] == TEAM_CRIMINAL)
{
tmp = strtok(cmdtext, idx);

if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kidnap [ID]");
return 1;
}
new pid = strval(tmp);
if(GetDistanceBetweenPlayers(playerid,pid) > 5) return SendClientMessage(playerid, COLOR_LIME, "You need to be with in 5 feet of your target to kidnap");
if (IsPlayerConnected(pid))
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(pid,vehicleid,3);
TogglePlayerControllable(playerid,0);
SendClientMessage(pid, COLOR_WHITE, "You have been kidnapped!");
}
}
else return SendClientMessage(playerid, COLOR_LIME, "Only Criminals can use this command.");
return 1;
}

Now what problem is that when i type /detain without an id, it displays the [else return SendClientMessage(playerid, COLOR_LIME, "Only Police Officers can use this command.");] line instead of the [SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [ID]");] line. But other than that, the detain works. When i type /kidnap how ever, it shows the [else return SendClientMessage(playerid, COLOR_LIME, "Only Police Officers can use this command.");] line, not the [else return SendClientMessage(playerid, COLOR_LIME, "Only Criminals can use this command.");] line.

What am i missing to get this to work properly?
chaosnz is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New and stumped. FaKeAnDgAy Client Support 2 20/06/2010 03:13 PM
What could be causing this ihatetn931 Help Archive 9 13/02/2010 07:27 AM
I am so stumped with this function! Paladin Help Archive 8 07/08/2009 11:15 PM
I'm Stumped, Error Help. (Edited LARP Script) Quincy_Gatlin Help Archive 3 19/06/2009 02:33 AM


All times are GMT. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.