stupid question :)... - 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)
+--- Thread: stupid question :)... (
/showthread.php?tid=393377)
stupid question :)... -
NeroX98 - 18.11.2012
Код:
CMD:p(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new text;
if(sscanf(params, "s", text)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /pitaj [text]");
new sendername[MAX_PLAYER_NAME];
new string[126];
new text1;
text1 = text;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Pitanje od %s-a: %s", sendername, text1);
ABroadCast(COLOR_ASKQ,string,1);
SendClientMessage(playerid, COLOR_ASKQ, "Vase pitanje je poslato Adminima & GameHeroima.");
}
return 1;
}
I'm new with ZCMD... I've try to learn how to script with ZCMD+sscanf but nothing. What's the problem with the command ?
Re: stupid question :)... -
JaKe Elite - 18.11.2012
remove the new text1; and text1= text.
You don't need that, sscanf is different than strtok.
pawn Код:
CMD:p(playerid, params[])
{
new text;
if(sscanf(params, "s", text)) return SendClientMessage(playerid, COLOR_WHITE, "Koristenje: /pitaj [text]");
new sendername[MAX_PLAYER_NAME];
new string[126];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Pitanje od %s-a: %s", sendername, text);
ABroadCast(COLOR_ASKQ,string,1);
SendClientMessage(playerid, COLOR_ASKQ, "Vase pitanje je poslato Adminima & GameHeroima.");
return 1;
}
Re: stupid question :)... -
NeroX98 - 18.11.2012
LOL
I'm really noob. REP +1
Re: stupid question :)... -
JaKe Elite - 18.11.2012
oopppsss sorry forgot something
pawn Код:
new text[128];
if(sscanf(params, "s[128]", text)) return //your error code here
If you didn't replace it with this code you will receive warnings in the console..
Re: stupid question :)... -
Sting. - 18.11.2012
Well don't call yourself a noob. Well we all go through that stage where we have to
learn to become good in it.