SA-MP Forums Archive
Undefined Simbol "SendCommand" - 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: Undefined Simbol "SendCommand" (/showthread.php?tid=268775)



Undefined Simbol "SendCommand" - Amel_PAtomAXx - 13.07.2011

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

thanks

- Patomaxx


Re: Undefined Simbol "SendCommand" - Calgon - 13.07.2011

Do you mean OnPlayerCommandText?


Re: Undefined Simbol "SendCommand" - [MG]Dimi - 13.07.2011

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


Re: Undefined Simbol "SendCommand" - Amel_PAtomAXx - 13.07.2011

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 :/


Re: Undefined Simbol "SendCommand" - jameskmonger - 13.07.2011

No, only NPCs can use SendCommand.


Re: Undefined Simbol "SendCommand" - [MG]Dimi - 13.07.2011

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


Re: Undefined Simbol "SendCommand" - Calgon - 13.07.2011

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;
}



Re: Undefined Simbol "SendCommand" - Amel_PAtomAXx - 13.07.2011

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;
}