D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(407) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(407) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(409) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(409) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(411) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(411) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(411) : warning 202: number of arguments does not match definition D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(411) : warning 202: number of arguments does not match definition Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 8 Warnings.
CMD:jail(playerid, params[])
{
new id, mins, str[128];
new JailTimer[MAX_PLAYERS];
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_RED,"You need to be level 4 to use that command!");
if(sscanf(params, "us[128]", id, mins))
return SendClientMessage(playerid,TEAM_GROVE_COLOR,"USAGE: /jail [ID][MINS]");
if (id == INVALID_PLAYER_ID)
return SendClientMessage(playerid,COLOR_RED,"Error: Player is not connected!");
new Name[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, Name2, sizeof(Name2));
SetPlayerPos(playerid, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(playerid, 6);
JailTimer[id] = SetTimerEx("Unjail", mins*60*1000, 0, "d", id);
format(str, sizeof(str), "You jailed %s for %d mins.", GetPlayerName(id), mins); //warning
SendClientMessage(playerid, TEAM_GROVE_COLOR, str);
format(str, sizeof(str), "%s jailed you for %d mins.", GetPlayerName(playerid), mins); //warning
SendClientMessage(id, COLOR_RED, str);
format(str, sizeof(str), "Administrator %s has jailed %s for %d mins!", GetPlayerName(playerid),GetPlayerName(id), mins); //warning
SendClientMessageToAll(COLOR_RED, str);
return 1;
}
GetPlayerName(playerid, const name[], len)
GetPlayerName(id)
GetPlayerName Syntax:
pawn Код:
pawn Код:
|
CMD:jail(playerid, params[])
{
new id, mins, str[128];
new JailTimer[MAX_PLAYERS];
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_RED,"You need to be level 4 to use that command!");
if(sscanf(params, "us[128]", id, mins))
return SendClientMessage(playerid,TEAM_GROVE_COLOR,"USAGE: /jail [ID][MINS]");
if (id == INVALID_PLAYER_ID)
return SendClientMessage(playerid,COLOR_RED,"Error: Player is not connected!");
new Name[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, Name2, sizeof(Name2));
SetPlayerPos(playerid, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(playerid, 6);
JailTimer[id] = SetTimerEx("Unjail", mins*60*1000, 0, "d", id);
format(str, sizeof(str), "You jailed %s for %d mins.", GetPlayerName(playerid, const name[], len), mins); //error
SendClientMessage(playerid, TEAM_GROVE_COLOR, str);
format(str, sizeof(str), "%s jailed you for %d mins.", GetPlayerName(playerid, const name[], len), mins);
SendClientMessage(id, COLOR_RED, str);
format(str, sizeof(str), "Administrator %s has jailed %s for %d mins!", GetPlayerName(playerid, const name[], len), GetPlayerName(playerid, const name[], len), mins);
SendClientMessageToAll(COLOR_RED, str);
return 1;
}
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(407) : error 029: invalid expression, assumed zero D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(407) : error 017: undefined symbol "name" D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(407) : error 029: invalid expression, assumed zero D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(407) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
format(str, sizeof(str), "You jailed %s for %d mins.", GetPlayerName(playerid, const name[], len), mins);
format(str, sizeof(str), "You jailed %s for %d mins.", Name2, mins);
format(str, sizeof(str), "%s jailed you for %d mins.", GetPlayerName(playerid, const name[], len), mins);
format(str, sizeof(str), "%s jailed you for %d mins.", Name, mins);
format(str, sizeof(str), "Administrator %s has jailed %s for %d mins!", GetPlayerName(playerid, const name[], len), GetPlayerName(playerid, const name[], len), mins);
format(str, sizeof(str), "Administrator %s has jailed %s for %d mins!", Name, Name2, mins);
GetPlayerName(playerid, const name[], len)
new
Name[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, Name, sizeof( Name ) ); // We get the Name from the player and we store it to `Name`
enum pInfo
{
pAdmin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new JailTimer[MAX_PLAYERS]; // Should be outside as it's a global variabel.
command(jail, playerid, params[])
{
new pID, Minutes, string[128];
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, 0x0, "You need to be level 4 to use that command!");
if(sscanf(params, "ui", pID, Minutes)) return SendClientMessage(playerid, 0x0, "USAGE: /jail [ID][MINS]");
if(pID == INVALID_PLAYER_ID || !IsPlayerConnected(pID)) return SendClientMessage(playerid, 0x0, "Error: Player is not connected!");
SetPlayerPos(pID, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(pID, 6);
JailTimer[pID] = SetTimerEx("Unjail", Minutes * 60 * 1000, 0, "d", pID);
format(string, sizeof(string), "You jailed %s for %d minutes.", GetPlayerNameEx(pID), Minutes); //warning
SendClientMessage(playerid, 0x0, string);
format(string, sizeof(string), "%s jailed you for %d minutes.", GetPlayerNameEx(playerid), Minutes); //warning
SendClientMessage(pID, 0x0, string);
format(string, sizeof(string), "Administrator %s has jailed %s for %d mins!", GetPlayerNameEx(playerid), GetPlayerNameEx(pID), Minutes); //warning
SendClientMessageToAll(0x0, string);
return 1;
}
stock GetPlayerNameEx(playerid)
{
new pName[25];
GetPlayerName(playerid, pName, 25);
return pName;
}
@Dwane
Well, no errors, but when I type: /jail 0 1, there's written that I jailed myself for 49 minutes! :O It should be only 1 minute, not 49! Also, a player is able to escape with /kill... He shouldn't be able to type any command inside there! >< |