SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 02/03/2013, 01:56 PM   #1
Blackazur
High-roller
 
Join Date: Apr 2012
Posts: 1,407
Reputation: 12
Default Spec Command bugged

Code:
CMD:spec(playerid,params[])
{
    if(pInfo[playerid][pLogged] == 1)
    {
    if(pInfo[playerid][pAdminLevel] >= 1)
    {
    new id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"Usage: /spec <player>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Player is not connected!");

	TogglePlayerSpectating(playerid,1);
    PlayerSpectatePlayer(playerid,id);
    }
		else {
		SendClientMessage(playerid,-1,""chat""COL_GRUEN" You have not the sufficient privileges to use this command.");
			}
	}
		else {
	    SendClientMessage(playerid,-1,""chat" You are not logged in!");
	    Kick(playerid);
	}
	return 1;
}
The problem is that the admin die, when he use the cmd. Know everyone why?
Blackazur is offline   Reply With Quote
Old 02/03/2013, 02:09 PM   #2
Patrick
Guest
 
Posts: n/a
Default Re: Spec Command bugged

Try this. im not sure about it. but give it a try
pawn Code:
CMD:spec(playerid,params[])
{
    new id;
    if(pInfo[playerid][pLogged] == 0)
    {
        SendClientMessage(playerid,-1,""chat" You are not logged in!");
        Kick(playerid);
        return 1;
    }
    if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,-1,""chat""COL_GRUEN" You have not the sufficient privileges to use this command.");
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"Usage: /spec <player>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Player is not connected!");
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, id);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    return 1;
}
  Reply With Quote
Old 02/03/2013, 02:19 PM   #3
Blackazur
High-roller
 
Join Date: Apr 2012
Posts: 1,407
Reputation: 12
Default Re: Spec Command bugged

"undefined Symbol: Spectating Player".
Blackazur is offline   Reply With Quote
Old 02/03/2013, 02:38 PM   #4
Patrick
Guest
 
Posts: n/a
Default Re: Spec Command bugged

Try my command again.

Edited
  Reply With Quote
Reply

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
Spec command help Cheynoa Scripting Help 4 25/01/2013 09:10 PM
Spec command REP + Dare Devil..... Scripting Help 4 06/08/2012 11:50 AM
/spec bugged (Ravens RP) Dragony92 Help Archive 3 14/08/2011 07:48 AM
Please Help spec command yarrum3 Help Archive 3 09/03/2011 08:34 AM
help with /spec command YungGee Help Archive 3 09/02/2011 02:43 PM


All times are GMT. The time now is 12:15 PM.


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