29.10.2012, 17:55
ok so i downloaded this fs from here (dont remember from where Sorry!) and had this lines
I made many cmds by strcmp but no one work not even gives an error!
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/snow", cmdtext, true, 5) == 0) // Put snow for all players (Administrator)
{
for(new i = 0; i <MAX_PLAYERS; i++){
if(!IsPlayerConnected(i)) continue;
if(IsPlayerAdmin(i)){
if(SnowOff[i] == 0){
AttachObjectToPlayer(Snow[i], i, 1.5, 0.5, 0, 0, 1.5, 2);
SnowOff[i] = 0;}}}
return 1;
}
if (strcmp("/removesnow", cmdtext, true, 7) == 0) // Removed snow for all players (Administrator)
{
for(new i = 0; i <MAX_PLAYERS; i++){
if(!IsPlayerConnected(i)) continue;
if(IsPlayerAdmin(i)){
if(SnowOff[i] == 1){
DestroyPlayerObject(i, Snow[i]);
SnowOff[i] = 1;}}}
return 1;
}
if (strcmp("/snowon", cmdtext, true, 7) == 0) // Put snow for you
{
if(SnowOff[playerid] == 0) return SendClientMessage(playerid, red, "Vous avez mit la neige pour vous.");
AttachObjectToPlayer(Snow[playerid], playerid, 1.5, 0.5, 0, 0, 1.5, 2);
SnowOff[playerid] = 0;
return 1;
}
if (strcmp("/snowoff", cmdtext, true, 8) == 0) // Remove snow for you
{
if(SnowOff[playerid] == 1) return SendClientMessage(playerid, red, "Vous avez enlever la neige pour vous.");
DestroyPlayerObject(playerid, Snow[playerid]);
SnowOff[playerid] = 1;
return 1;
}
return 0;
}