CMD:snow(playerid, params[]) { if(snowOn{playerid}) { DeleteSnow(playerid); SendClientMessage(playerid, 0x00FF00AA, "* A hуesйs elбllt!"); } else { CreateSnow(playerid); SendClientMessage(playerid, 0x00FF00AA, "* A hуesйs elindult!"); } return 1; } CMD:allsnowon(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return 0; ploop(i) //This is included in my FS! It's the '#define ploop(%0)' thing. { if(snowOn{i}) continue; CreateSnow(i); } return 1; } CMD:allsnowoff(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return 0; ploop(i) { if(!snowOn{i}) continue; DeleteSnow(i); } return 1; }
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/snow",true) == 0)
{
if(snowOn{playerid})
{
DeleteSnow(playerid);
SendClientMessage(playerid, 0x00FF00AA, "* A hуesйs elбllt!");
}
else
{
CreateSnow(playerid);
SendClientMessage(playerid, 0x00FF00AA, "* A hуesйs elindult!");
}
return 1;
}
if(strcmp(cmdtext,"/allsnowon",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
ploop(i) //This is included in my FS! It's the '#define ploop(%0)' thing.
{
if(snowOn{i}) continue;
CreateSnow(i);
}
return 1;
}
if(strcmp(cmdtext,"/allsnowoff",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
ploop(i)
{
if(!snowOn{i}) continue;
DeleteSnow(i);
}
return 1;
}
return 0;
}
Even though it's not the best decision, it is what he's asking for after all, and we are here to help.
- code - |
if(strcmp(cmd, "/snow", true) == 0) { if(snowOn{playerid}) { DeleteSnow(playerid); SendClientMessage(playerid, 0x00FF00AA, "* A hуesйs elбllt!"); } else { CreateSnow(playerid); SendClientMessage(playerid, 0x00FF00AA, "* A hуesйs elindult!"); } return 1; } if(strcmp(cmd, "/allsnowon", true) == 0) { if(!IsPlayerAdmin(playerid)) return 0; ploop(i) //This is included in my FS! It's the '#define ploop(%0)' thing. { if(snowOn{i}) continue; CreateSnow(i); } return 1; } if(strcmp(cmd, "/allsnowoff", true) == 0) { if(!IsPlayerAdmin(playerid)) return 0; ploop(i) { if(!snowOn{i}) continue; DeleteSnow(i); } return 1; } |
Giving him an answer while providing a code without explaining anything isn't helping.
Telling him that he should learn how ZCMD works - and preferrably start using it - however is. |
It is only giving him advice. He asked for code (or a convert to be precise) so there is nothing wrong with his post. I don't really get why you have to get so upset about this?
|
He asked for code (or a convert to be precise) so there is nothing wrong with his post.
|
[..]especially rule #7 - which is by the way a stickied thread: https://sampforum.blast.hk/showthread.php?tid=355296[..]
|
It is only giving him advice. He asked for code (or a convert to be precise) so there is nothing wrong with his post. I don't really get why you have to get so upset about this?
|
Converting this code to strcmp would be like exchanging a Lamborghini for a Lada.
|