I need help here with / climate - 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: I need help here with / climate (
/showthread.php?tid=610972)
I need help here with / climate -
baela - 30.06.2016
Guys when I 'm going to use the command / climate climate changes do not help me?
PHP код:
if(strcmp(cmd,"/clima",true) == 0){
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new weatherid;
tmp = strtok(cmdtext,idx);
weatherid = strval(tmp);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /Clima [ID]");
return 1;
}
if(weatherid < -66 || weatherid > 45){
SendClientMessage(playerid, Vermelho, "| ERRO | ID invбlido!");
return 1;
}else{
SetWeather(weatherid);
new Names[30];
GetPlayerName(playerid,Names,sizeof(Names));
format(string,sizeof(string),"| INFO-SERVER | O(a) Administrador(a) %s mudou o clima para '%d' !",Names,weatherid);
SendClientMessageToAll(ocd, string);
return 1;
}
}
}
Re: I need help here with / climate -
moura98 - 30.06.2016
Try it
PHP код:
if(strcmp(cmd,"/clima",true) == 0)
{
if(pAdmin[playerid] < 1 || pAdmin[playerid] > 5) return SendClientMessage(playerid, -1, "you no have permission");
new weatherid, string[128];
tmp = strtok(cmdtext,idx);
weatherid = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /Clima [ID]");
if(weatherid < -66 || weatherid > 45) return SendClientMessage(playerid, Vermelho, "| ERRO | ID invбlido!");
SetWeather(weatherid);
new Names[30];
GetPlayerName(playerid,Names,sizeof(Names));
format(string,sizeof(string),"| INFO-SERVER | O(a) Administrador(a) %s mudou o clima para '%d' !",Names,weatherid);
SendClientMessageToAll(playerid, string);
return 1;
}
Re: I need help here with / climate -
DTV - 01.07.2016
Did you declare idx anywhere?