Need help with Release command! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with Release command! (
/showthread.php?tid=251687)
Need help with Release command! -
Admigo - 28.04.2011
Heey guys
I made a kidnap command.
Code:
Код:
dcmd_kidnap(playerid, params[])
{
new id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/kidnap <playerid>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "[Server] Player not found");
else
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerSkin(playerid) == 116)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
{
PutPlayerInVehicle(id,vehicleid,1);
TogglePlayerControllable(id,0);
SendClientMessage(id, COLOR_RED, "[Server] You have been kidnapped");
SendClientMessage(playerid, 0x00FF00AA, "[Server] You kidnapped someone");
}
else
{
SendClientMessage(playerid, COLOR_RED, "[Server] You must be near the player you want to kidnap");
}
}
else { SendClientMessage(playerid, COLOR_RED, "[Server] You are not a kidnapper!"); }
}
return 1;
}
But how can i make a release command?
Thanks Admigo
Re: Need help with Release command! -
Admigo - 28.04.2011
I made a release command:
Код:
dcmd_release(playerid, params[])
{
new id2;
if (sscanf(params, "u", id2)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/release <playerid>\"");
else if (id2 == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "[Server] Player not found");
else
{
if(GetPlayerSkin(playerid) == 116)
{
if(GetPlayerVehicleSeat(id2)==1)
{
RemovePlayerFromVehicle(id2);
TogglePlayerControllable(id2,1);
SendClientMessage(id2, 0x00FF00AA, "[Server] You have been released");
SendClientMessage(playerid, COLOR_RED, "[Server] You released the player!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "[Server] You haven't kidnap someone!");
}
}
else { SendClientMessage(playerid, COLOR_RED, "[Server] You are not a kidnapper!"); }
}
return 1;
}
But if i do /release 1 or /release it says unknow command.
Pls help!
Re: Need help with Release command! -
Admigo - 28.04.2011
FIXED BY MYSELF!