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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (/showthread.php?tid=185471)



Help - dark_clown - 24.10.2010

iv NEVER used cases before so i went to ladmin to get some examples
but what i want to do dosnt change its with setalltime but it dosnt set time
it dosnt change anyone's time not even mine
Код:
dcmd_setalltime(playerid, params[])
{
	#pragma unused params
	new time;
	if(sscanf(params,"s[128]",time)) return SendClientMessage(playerid, ORANGE, "USAGE: /setalltime [night/day]");
	if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid, red, "ERROR: You must be level 3");
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    switch (time){
	    case 1:	SetPlayerTime(playerid,0,0);
   		case 2:	SetPlayerTime(playerid,12,0);
   		}
	}
	return 1;
}



Re: Help - iJumbo - 24.10.2010

use
pawn Код:
if(!strcmp(params, "night", true))
{
code here
}
if(!strcmp(params, "day", true))
{
code here
}