Spec command help
#1

C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : error 017: undefined symbol "giveplayer"
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : error 017: undefined symbol "giveplayer"
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : fatal error 107: too many error messages on one line

COMMANDpec(playerid, params[])
{
new tmp[256];
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [Player ID]");
return 1;
}
new plo;
plo = strval(tmp);
GetPlayerName(plo, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (IsPlayerConnected(plo))
{
if ((IsStaff_L4R(playerid)) || L2S[playerid]==1 )
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, plo);
format(prpstring, sizeof(prpstring), "(SSINFO) You are now spectating %s (ID:%d).", giveplayer,plo);
SendClientMessage(playerid, COLOR_YELLOW, prpstring);

}
else
{
return 0;
}
}
else
{
format(prpstring, sizeof(prpstring), "%d is not an active player.", plo);
SendClientMessage(playerid, COLOR_BRIGHTRED, prpstring);
}
return 1;
}
Reply
#2

Try this:
pawn Код:
COMMAND:spec(playerid)
{
    new tmp[256];
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [Player ID]");

    new plo, giveplayer[MAX_PLAYER_NAME + 3];
    plo = strval(tmp);
    GetPlayerName(plo, giveplayer, sizeof giveplayer);
    if(IsPlayerConnected(plo))
    {
    if(IsStaff_L4R(playerid))
    {
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, plo);
        format(prpstring, sizeof(prpstring), "(SSINFO) You are now spectating %s (ID:%d).", giveplayer,plo);
        SendClientMessage(playerid, COLOR_YELLOW, prpstring);
    }
        else return 0;
    }
    else
    {
        format(prpstring, sizeof(prpstring), "%d is not an active player.", plo);
        SendClientMessage(playerid, COLOR_BRIGHTRED, prpstring);
    }
    return 1;
}
You have not defined giveplayer
Reply
#3

wow got more errors but fixed that

C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : error 017: undefined symbol "L2S"
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : warning 215: expression has no effect
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : error 001: expected token: ";", but found "]"
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\FCRP ECRP\gamemodes\ProjectElgin.pwn(42571) : fatal error 107: too many error messages on one line
Reply
#4

Try now, I've edited that post
Reply
#5

So far so good just need to try it out now I appreciate the help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)