SA-MP Forums Archive
undefined symbol "cmdtext" - 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 symbol "cmdtext" (/showthread.php?tid=154754)



undefined symbol "cmdtext" - Ihsan_Cingisiz - 15.06.2010

How can i define this then?


Re: undefined symbol "cmdtext" - Luka P. - 15.06.2010

In which function/callback do you use it?


Re: undefined symbol "cmdtext" - Ihsan_Cingisiz - 15.06.2010

Quote:
Originally Posted by Luka P.
In which function/callback do you use it?
Quote:

public TypeTutorial(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
SendClientMessage(i, COLOR_LIGHTGREEN, "");
SendClientMessage(i, COLOR_LIGHTGREEN, "");
SendClientMessage(i, COLOR_LIGHTGREEN, "");
SendClientMessage(i, COLOR_LIGHTGREEN, "");
SendClientMessage(i, COLOR_LIGHTGREEN, "");
SendClientMessage(i, COLOR_LIGHTGREEN, "[==| Where does RP stand for? |==]");
SendClientMessage(i, COLOR_LIGHTGREEN, "[==| 1. RealPlay ");
SendClientMessage(i, COLOR_LIGHTGREEN, "[==| 2. RolePlay ");
SendClientMessage(i, COLOR_LIGHTGREEN, "[==| 3. RapingPeople ");
if(!strcmp("2", cmdtext, true, 1) == 0)
{
SendClientMessage(i, COLOR_LIGHTGREEN, "Good");
}
}
return 1;
}

I'm making a type tutorial this is a test, but cmdtext doesn't work


Re: undefined symbol "cmdtext" - Dolph - 15.06.2010

Off-topic(kinda): its "What does RP stand for" not "Where does RP stand for?


Re: undefined symbol "cmdtext" - Ihsan_Cingisiz - 15.06.2010

Quote:
Originally Posted by Dolph
Off-topic(kinda): its "What does RP stand for" not "Where does RP stand for?
Thanks, i know i made just a fast example for how it was, i was on my laptop
and in my Lap i don't have my GM.. Thanks anyways


Re: undefined symbol "cmdtext" - Luka P. - 15.06.2010

@ Ihsan - you can't use cmdtext here because TypeTutorial doesn't have it...
Here is an solution for what you want

pawn Код:
forward TypeTutorial(playerid);
new bool:RP_Test_Active;
pawn Код:
public TypeTutorial(playerid)
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        for(new i=0; i < 4; i++) SendClientMessage(i, COLOR_LIGHTGREEN, "");
   
        SendClientMessage(i, COLOR_LIGHTGREEN, "[==| What does RP stand for? |==]");
        SendClientMessage(i, COLOR_LIGHTGREEN, "[==| 1. RealPlay         ");
        SendClientMessage(i, COLOR_LIGHTGREEN, "[==| 2. RolePlay         ");
        SendClientMessage(i, COLOR_LIGHTGREEN, "[==| 3. RapingPeople       ");  
    }
    RP_Test_Active = true;
    return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
     if(!strcmp(text, "2", true, 1) && RP_Test_Active){ SendClientMessage(i, COLOR_LIGHTGREEN, "Good"); RP_Test_Active = false; return 0; }
     return 1;
}
EDIT: Lol I saw ur using playerid parameter in TypeTutorial function and then looping through all players... wierd, but thats your script








Re: undefined symbol "cmdtext" - Niixie - 15.06.2010

Quote:
Originally Posted by Luka P.
EDIT: Lol I saw ur using playerid parameter in TypeTutorial function and then looping through all players... wierd, but thats your script
Yea,Ihsan, you need to be aware of that. This will show the text to everyone on the server. not only the person who should have the question. use playerid insted of i and remove the loop