SA-MP Forums Archive
Help.. - 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: Help.. (/showthread.php?tid=590342)



Help.. - itachi - 28.09.2015

CMD(playerid,params[])
{

new ID;
if(IsPlayerAdmin(playerid) || Sav[Admin][playerid] > 0)
if(sscanf(params, "us[100]", ID)) return SCM(playerid,0xFF0000AA,"Error: /p ID");

SCM(ID,-1,"{FFFFFF} Welcome bla bla bla.....");
return 1;
}
If admin send cmd /p 0
so send to back Error: /p ID


Re: Help.. - nezo2001 - 28.09.2015

Can't understand :3


Re: Help.. - itachi - 28.09.2015

sorry Iam czech

If admin send cmd /p ID,so command answer Error: /p ID


Re: Help.. - IceBilizard - 28.09.2015

like this?

pawn Код:
CMD:p(playerid,params[])
{

new ID;
if(!IsPlayerAdmin(playerid) || Sav[Admin][playerid] < 1) return 0;
if(sscanf(params, "us[100]", ID)) return SCM(playerid,0xFF0000AA,"Error: /p ID");
if(!IsPlayerConnected(ID) return SCM(playerid, 0xFF0000AA, "Error: /p ID");
}



Re: Help.. - itachi - 28.09.2015

error 001: expected token: ")", but found "return"

if(!IsPlayerConnected(ID) return SCM(playerid, 0xFF0000AA, "Error: /p ID");


Re: Help.. - TheLegend1 - 28.09.2015

if(!IsPlayerConnected(ID) return SCM(playerid, 0xFF0000AA, "Error: /p ID"));


Re: Help.. - IceBilizard - 28.09.2015

pawn Код:
CMD:p(playerid,params[])
{

new ID;
if(!IsPlayerAdmin(playerid) || Sav[Admin][playerid] < 1) return 0;
if(sscanf(params, "us[100]", ID)) return SCM(playerid,0xFF0000AA,"Error: /p ID");
if(ID == playerid) return SCM(playerid, 0xFF0000AA, "Error: /p ID");
if(!IsPlayerConnected(ID)) return SCM(playerid, 0xFF0000AA, "Error: /p ID");
}



Re: Help.. - jlalt - 28.09.2015

Quote:
Originally Posted by TheLegend1
Посмотреть сообщение
if(!IsPlayerConnected(ID) return SCM(playerid, 0xFF0000AA, "Error: /p ID"));
LOOOOOOOL DUDE XDDDD KIDING ?
PHP код:
if(!IsPlayerConnected(ID)) return SCM(playerid0xFF0000AA"Error: /p ID"); 
he miss ) after ID should be ID)) not ID)


Re: Help.. - nezo2001 - 28.09.2015

PHP код:
CMD:p(playerid,params[])
{
new 
ID;
if(!
IsPlayerAdmin(playerid) || Sav[Admin][playerid] < 1) return 0;
if(
sscanf(params"us[100]"ID)) return SCM(playerid,0xFF0000AA,"Error: /p ID");
if(!
IsPlayerConnected(ID)) return SCM(playerid0xFF0000AA"Error: /p ID");
return 
1;

Edit: lol they got me x'D


Re: Help.. - CalvinC - 28.09.2015

Also the sscanf should be:
Код:
if(sscanf(params, "u", ID))
Since you're not using the string (s[100]).