dcmd_slap(playerid,params[])
{
if(!PLVL[playerid]) return 0;
new pid;
if(PlayerInfo[playerid][pAdminLevel] >=1)
{
if(sscanf(params, "u", pid)) return SendClientMessage(playerid, Yellow, "Usage: /slap <playerid>");
if(IsPlayerConnected(pid))
{
new Float:Pos[3], string[128], adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], moneys = strval(params);
GetPlayerPos(pid,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(pid,Pos[0],Pos[1],Pos[2]+moneys);
format(string, sizeof(string), "Admin %s has slapped %s for %d meters", adminname, paramname, moneys);
MessageToAdmins(AdminColor, string);
} else SendClientMessage(playerid, Red, "This player is not connected");
} else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
return 1;
}
dcmd_givegun(playerid, params[])
{
if(!PLVL[playerid]) return 0;
new id, gunid, ammo, gunname[50];
new idx, String[128];
String = strtok(params, idx);
if(PlayerInfo[playerid][pAdminLevel] < 3) return 0;
if(sscanf(params, "dsd", id, gunid, ammo)) return SendClientMessage(playerid, Yellow, "Usage: /givegun <playerid> <weaponid/name> <ammo>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Red, "Player is not connected");
if(gunid < 0 || gunid > 46) return SendClientMessage(playerid, Red, "Invalid weapon ID/name");
GetWeaponModelIDFromName(String);
if (!strlen(String))
if (!strlen(params[idx+1]))
GivePlayerWeapon(id, gunid, ammo);
GetGunName(gunid, gunname, 50);
format(String, 128, "Admin has given you a %s with %d bullets", gunname, ammo);
SendClientMessage(id, AdminColor, String);
return 1;
}
dcmd_givegun(playerid, params[])
{
if(!PLVL[playerid]) return 0;
new id, gunid, ammo, gunname[32];
new idx, String[128];
String = strtok(params, idx);
if(PlayerInfo[playerid][pAdminLevel] < 3) return 0;
if(sscanf(params, "udd", id, gunid, ammo)) return SendClientMessage(playerid, Yellow, "Usage: /givegun <playerid> <weaponid/name> <ammo>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Red, "Player is not connected");
if(gunid < 0 || gunid > 46) return SendClientMessage(playerid, Red, "Invalid weapon ID/name");
GetWeaponModelIDFromName(String);
if (!strlen(String))
if (!strlen(params[idx+1]))
GivePlayerWeapon(id, gunid, ammo);
GetWeaponName(gunid,gunname,32);
format(String, 128, "Admin has given you a %s with %d bullets", gunname, ammo);
SendClientMessage(id, AdminColor, String);
return 1;
}
if(sscanf(params, "usd", id, gunid, ammo)) return SendClientMessage(playerid, Yellow, "Usage: /givegun <playerid> <weaponid/name> <ammo>");
pawn Код:
|
if(sscanf(params, "udd", id, gunid, ammo)) return SendClientMessage(playerid, Yellow, "Usage: /givegun <playerid> <weaponid/name> <ammo>");
dcmd_slap(playerid,params[])
{
if(!PLVL[playerid]) return 0;
new pid, moneys;
if(PlayerInfo[playerid][pAdminLevel] >=1)
{
if(sscanf(params, "ud", pid, moneys)) return SendClientMessage(playerid, Yellow, "Usage: /slap <playerid>");
if(IsPlayerConnected(pid))
{
new Float:Pos[3], string[128], adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], moneys = strval(params);
GetPlayerPos(pid,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(pid,Pos[0],Pos[1],Pos[2]+moneys);
format(string, sizeof(string), "Admin %s has slapped %s for %d meters", adminname, paramname, moneys);
MessageToAdmins(AdminColor, string);
} else SendClientMessage(playerid, Red, "This player is not connected");
} else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
return 1;
}
E:\GTA San Andreas\Server\gamemodes\DMWorld.pwn(1119) : warning 219: local variable "moneys" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.