SA-MP Forums Archive
[HELP]Dcmd - 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]Dcmd (/showthread.php?tid=206217)



[HELP]Dcmd - buzifej - 03.01.2011

What's the error?
dcmd_mytime(playerid,params[]) {

new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, " /settime [hour]");
new player1 = strval(tmp), time = strval(tmp2), string[128];
if(IsPlayerConnected(player1)) {

PlayerPlaySound(player1,1057,0.0,0.0,0.0);
return SetPlayerTime(player1, time, 0);

}

}


Re: [HELP]Dcmd - HyperZ - 03.01.2011

You want this?:
pawn Код:
dcmd_mytime(playerid,params[]) {
    if(!strlen(params)) return SendClientMessage(playerid, 0x00FFFFAA, "USAGE: /mytime [hour]");
    new time = strval(params), string[128];
    format(string,sizeof(string),"You have set your time to %d:00", time); SendClientMessage(playerid,0x00FFFFAA,string);
    return SetPlayerTime(playerid, time, 0);
}
Or you want /settime playerid hour?