19.03.2011, 00:26
when i do /createlaw1 the file wont create on myserver/gang/%i.txt
pawn Код:
CMD:createlaw1(playerid, params[])
{
new str[128],wep1,wep2,wep3,id, ammo, name[40], file[256];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
if(sscanf(params,"uiiiis", id,wep1,wep2,wep3,ammo,name)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /createlaw1 [id] [wep1] [wep2] [wep3] [ammo] [name]");
if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
if(wep1 > 0 && wep1 < 36)
if(wep2 > 0 && wep2 < 36)
if(wep3 > 0 && wep3 < 36)
{
if(ammo > 0 && ammo < 5000)
{
format(str, sizeof(str), "An Admin has set you the leader of %s",name);
SendClientMessage(id,0xFF9900AA, str);
IsLaw[id] = 1;
Member[id] = 1;
Leader[id] = 1;
IsInOrg[id] = 1;
GivePlayerWeapon(id,wep1, ammo);
GivePlayerWeapon(id,wep2, ammo);
GivePlayerWeapon(id,wep3, ammo);
format(str,sizeof(str),"myserver/gang/%i.txt");
if(dini_Exists(str))return SendClientMessage(playerid,0xFF0000FF,"Error: That org is already created");
if(dini_Exists(file))
{
dini_Create(file);
dini_IntSet(str,"Ammo",ammo);
dini_IntSet(str,"Weapon1",wep1);
dini_IntSet(str,"Weapon2",wep2);
dini_IntSet(str,"Weapon3",wep3);
dini_Set(str,"Leader",name);
dini_Set(str,"Org Name",name);
}
return 1;
}
else return SendClientMessage(playerid,0xFF0000FF, "Ammo must be between 0 And 5000.");
}
else
{
SendClientMessage(playerid,0xFF0000FF, "Invalid Weapon ID!");
}
return 1;
}