CMD:loc(playerid, params[]) { new giveplayerid, string[256], giveplayer[25]; if(sscanf(params, "u", giveplayerid)) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /loc [playerid]"); if (GetPVarInt(playerid, "playerorg") != 0) { if(!IsALaw(playerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: You are not a law enforcer!"); } else return SendClientMessage2(playerid, COLOR_RED, "Error: You are not a law enforcer!"); if (GetPVarInt(playerid, "podfskin") == -1) return SendClientMessage2(playerid, COLOR_RED, "{FF5357}Error: {FFFFFF}You are off duty."); if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "{FF5357}Error: {FFFFFF}Inactive player id!"); GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME); if (GetPlayerWantedLevel(giveplayerid) == 0) return SendPlayerFormattedText(playerid, COLOR_RED, "{FF5357}Error: {FFFFFF}%s isn't a wanted player.", giveplayer, ""); if (orcl[giveplayerid][0] != 0) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: %s isn't spawned.", giveplayer, ""); SendClientMessage2(playerid, COLOR_WHITE, "Requesting intel on suspect..."); //LocTimer is the name of the forward, which I created bellow SetTimerEx("LocTimer", 5000, false, "i", playerid, "i", giveplayerid); //5000 equals 5 seconds, because it is in milisecondsSetTimerEx("LocTimer", 5000, false, "i", playerid, "i", giveplayerid); //5000 equals 5 seconds, because it is in miliseconds return 1; } forward LocTimer(playerid,giveplayerid); //Here Is the created forward public LocTimer(playerid,giveplayerid) //Here we are using the forward with the functions, which happen 5 seconds after typing the command { if (playerZone[giveplayerid] > sizeof(zonenames)-11) SendPlayerFormattedText(playerid, COLOR_WHITE, "[Location] %s was last reported seen in %s.", giveplayer, zonenames[playerZone[giveplayerid]][z_name]); else { format(string, 128, "[location] %s was last reported seen in %s, %s.", giveplayer, zonenames[playerZone[giveplayerid]][z_name], zonenames[sizeof(zonenames)-(zonetype[playerZone[giveplayerid]]+1)][z_name]); SendClientMessage2(playerid, COLOR_WHITE, string); } }
SetTimerEx("LocTimer", 5000, false, "ii", playerid, giveplayerid);
Try with
PHP код:
|
C:\Users\Wolfdale\Desktop\server stuff\VaultGaming\gamemodes\Vault1.pwn(30055) : warning 217: loose indentation C:\Users\BLANK\Desktop\server stuff\VaultGaming\gamemodes\Vault1.pwn(30057) : warning 217: loose indentation C:\Users\BLANK\Desktop\server stuff\VaultGaming\gamemodes\Vault1.pwn(30043) : warning 204: symbol is assigned a value that is never used: "string" C:\Users\BLANK\Desktop\server stuff\VaultGaming\gamemodes\Vault1.pwn(30063) : error 017: undefined symbol "giveplayer" C:\Users\BLANK\Desktop\server stuff\VaultGaming\gamemodes\Vault1.pwn(30066) : error 017: undefined symbol "string" C:\Users\BLANK\Desktop\server stuff\VaultGaming\gamemodes\Vault1.pwn(30067) : error 017: undefined symbol "string"
CMD:loc(playerid, params[])
{
new giveplayerid, string[256], giveplayer[25];
if(sscanf(params, "u", giveplayerid)) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /loc [playerid]");
if (GetPVarInt(playerid, "playerorg") != 0)
{
if(!IsALaw(playerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: You are not a law enforcer!");
}
else return SendClientMessage2(playerid, COLOR_RED, "Error: You are not a law enforcer!");
if (GetPVarInt(playerid, "podfskin") == -1) return SendClientMessage2(playerid, COLOR_RED, "{FF5357}Error: {FFFFFF}You are off duty.");
if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "{FF5357}Error: {FFFFFF}Inactive player id!");
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (GetPlayerWantedLevel(giveplayerid) == 0) return SendPlayerFormattedText(playerid, COLOR_RED, "{FF5357}Error: {FFFFFF}%s isn't a wanted player.", giveplayer, "");
if (orcl[giveplayerid][0] != 0) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: %s isn't spawned.", giveplayer, "");
SendClientMessage2(playerid, COLOR_WHITE, "Requesting intel on suspect...");
SetTimerEx("LocTimer", 5000, false, "ii", playerid, giveplayerid);
return 1;
}
forward LocTimer(playerid,giveplayerid); //Here Is the created forward
public LocTimer(playerid,giveplayerid) //Here we are using the forward with the functions, which happen 5 seconds after typing the command
{
new giveplayer[64], string[80];
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (playerZone[giveplayerid] > sizeof(zonenames)-11) SendPlayerFormattedText(playerid, COLOR_WHITE, "[Location] %s was last reported seen in %s.", giveplayer, zonenames[playerZone[giveplayerid]][z_name]);
else
{
format(string, 128, "[location] %s was last reported seen in %s, %s.", giveplayer, zonenames[playerZone[giveplayerid]][z_name], zonenames[sizeof(zonenames)-(zonetype[playerZone[giveplayerid]]+1)][z_name]);
SendClientMessage2(playerid, COLOR_WHITE, string);
}
}
Command:
PHP код:
PHP код:
|