Undefined Simbol "SendCommand"
#1

I got error when im compile , it say "undefined simbol SendCommand" lol , how to define it , or any help please ?

thanks

- Patomaxx
Reply
#2

Do you mean OnPlayerCommandText?
Reply
#3

Well SendCommand doesn't exsist xD
Give us your code so we can check it.


This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
Damn
Reply
#4

its exsist.
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,x,y,z);
SendCommand("/join");
return 1;
}
btw , its work on 0.3c , but not work on 0.3cR2 :/
Reply
#5

No, only NPCs can use SendCommand.
Reply
#6

Did you define anywhere SendCommand coz it simply doesn't exsist as pawno function
Reply
#7

It doesn't exist; It's not a native SA-MP function for Players, but that doesn't mean you can't make it yourself. I've renamed it to avoid collisions with the NPC function.

pawn Код:
#define SendPlayerCommand OnPlayerCommandText
Place the code above at (or near) the top of your script, and you'll be able to use it like so:

pawn Код:
public OnPlayerSpawn(playerid)
{
   SetPlayerPos(playerid,x,y,z); // I hope you've defined x, y and z as floats somewhere
   SendPlayerCommand(playerid, "/join");
   return 1;
}
Reply
#8

pawn Код:
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : warning 236: unknown parameter in substitution (incorrect #define pattern)
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : warning 236: unknown parameter in substitution (incorrect #define pattern)
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : error 029: invalid expression, assumed zero
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : warning 215: expression has no effect
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : error 029: invalid expression, assumed zero
C:\Documents and Settings\xy\Desktop\SAMP\samp03\gamemodes\walkwoods.pwn(115) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
hmm...

btw this is an exaple taken from wiki.samp
pawn Код:
public OnPlayerText(playerid, text[])
{
    if (strfind(text, "stupid bot") != -1)
    {
        new string[80], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
 
        SendCommand("/kill");
        format(string, sizeof(string), "Hey %s! You are so mean, you make me so sad!", name);
        SendChat(string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)