Can't seem to make commands only for a team with gteam
#1

Right im trying to make a command /help but when i compile it gives me mils of errors like playermoveobject is not implemented when all i want is the help command to show cops what they need to do and to show all the rest what they have to do can any one help me here.

Code:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/help", true) == 0)
{
if(gTeam[playerid] == 1)
{
SendClientMessage(playerid, COLOR_SKYBLUE, "you'r a cop you have to arrest people in ls");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You'r a civilian you have to run away from cops");
return 1;
}

errors:

C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(19 : error 017: undefined symbol "cmd"
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(202) : error 017: undefined symbol "COLOR_SKYBLUE"
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : warning 217: loose indentation
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(216) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(216) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(216) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(221) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(221) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(221) : error 004: function "OnPlayerStateChange" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(226) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(226) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(226) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(231) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(231) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(231) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(236) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(236) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(236) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(241) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(241) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(241) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(246) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(246) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(246) : error 004: function "OnRconCommand" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(251) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(251) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(251) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(256) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(256) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(256) : error 004: function "OnObjectMoved" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(261) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(261) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(261) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(266) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(266) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(266) : error 004: function "OnPlayerPickUpPickup" is not implemented

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#2

Can you show us the command code, and the errors that show?
Reply
#3

I don't understand what do you want, do you want a command only for police gTeam?

pawn Код:
#include   < a_samp >
#define    TEAM_POLICE    ( 8 )

new
    gTeam[ MAX_PLAYERS ]
;

public OnPlayerRequestClass( playerid, classid )
{
    if ( classid == 8 ) gTeam[ playerid ] = TEAM_POLICE, SendClientMessage( playerid, -1, "police" );

    return 1;
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if ( !strcmp( cmdtext, "/help", true ) )
    {
        if ( gTeam[ playerid ] != TEAM_POLICE )
            return SendClientMessage( playerid, -1, "You are not a police." );

        // Your stuffs came here

        return 1;
    }
 
    return 0;
}
Quote:

it gives me mils of errors like playermoveobject is not implemented

You don't have PlayerMoveObject function, about that error.
Reply
#4

i tryed with you'r code and it gave me same errors as befor lol
Reply
#5

#define Team_Cop 1
#define Team_Medic 2
#define Team_Army 3
#define Team_FBI 4
#define Team_Civi 5


new gTeam[MAX_PLAYERS];


public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);

switch(classid)
{
case 0, 1, 2, 3, 4, 5:
{
GameTextForPlayer(playerid, "~b~Police officer", 3000, 5);
}
case 6:
{
GameTextForPlayer(playerid, "~p~Los Santos Army", 3000, 5);
}
case 7:
{
GameTextForPlayer(playerid, "~b~FBI official", 3000, 5);
}
case 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29:
{
GameTextForPlayer(playerid, "~w~Civilian ~n~ Choose your job when you spawn", 3000, 5);
}
}
return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5)
{
gTeam[playerid] = Team_Cop;
}
else if(classid == 6)
{
gTeam[playerid] = Team_Army;
}
else if(classid == 7)
{
gTeam[playerid] = Team_FBI;
}
else if(classid >=
{
gTeam[playerid] = Team_Civi;
}
}

public SetPlayerToTeamColor(playerid)
{
if(gTeam[playerid] == Team_Cop)
{
SetPlayerColor(playerid, COLOR_BLUE);
}
if(gTeam[playerid] == Team_Army)
{
SetPlayerColor(playerid, COLOR_PURPLE);
}
if(gTeam[playerid] == Team_FBI)
{
SetPlayerColor(playerid, COLOR_BLUE);
}
if(gTeam[playerid] >= 5)
{
SetPlayerColor(playerid, COLOR_WHITE);
}
return 1;
}

incase you need
Reply
#6

the whole gamemode u have doesnt have
pawn Код:
#include <a_samp>
#define COLOR_BLUE 0x0000FFAA
#define COLOR_PURPLE 0xFF00FFAA // PINK
#define COLOR_WHITE 0xFFFFFFAA
add that on your top of your script
Reply
#7

it has them lmfao want me to send the whole script?
Reply
#8

Hold on, you got a missing brackets for this error
pawn Код:
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(19 : error 017: undefined symbol "cmd"
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(202) : error 017: undefined symbol "COLOR_SKYBLUE"
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : warning 217: loose indentation
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(211) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(216) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(216) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(216) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(221) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(221) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(221) : error 004: function "OnPlayerStateChange" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(226) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(226) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(226) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(231) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(231) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(231) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(236) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(236) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(236) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(241) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(241) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(241) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(246) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(246) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(246) : error 004: function "OnRconCommand" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(251) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(251) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(251) : error 004: function "OnPlayerRequestSpawn" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(256) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(256) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(256) : error 004: function "OnObjectMoved" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(261) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(261) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(261) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(266) : warning 225: unreachable code
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(266) : error 029: invalid expression, assumed zero
C:\Users\Nathan\Desktop\Freedem\pawno\rp.pwn(266) : error 004: function "OnPlayerPickUpPickup" is not implemented
Try to find it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)