18.04.2011, 20:29
(
Последний раз редактировалось Andregood; 04.08.2012 в 13:21.
)
Removed all.
Look, I've defined gTeam and RACE_VAMPIRES 2 (1 is humans)
And still when I setrace 2 it doesn't work.. Код:
CMD:vampirebite(playerid, params[]) { if(gTeam(playerid) != 2) return SendClientMessage(playerid, 0xAFAFAFAA, "You need to be a vampire to use this command"); // Checks if the team is RACE_VAMPIRES. If not, it returns the message that you have to be one. new pID; // Self-explanatory if(sscanf(params, "u", pID)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /vampirebite [playerid/name]"); if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xAFAFAFAA, "That player is currently not connected."); // Checks whether the ID is valid/connected new Float:hp; GetPlayerHealth(pID, hp); hp -= 30.0; SetPlayerHealth(pID, hp); return SendClientMessage(pID, 0xAFAFAFAA, "You've been bitten"); //After all the checks are done, sends this message if they all are passed. } |
command(setrace, playerid, params[]) { new pID, tID; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAFAFAFAA, "You need to be an rcon administrator to use this command"); if(sscanf(params, "ui", pID, tID)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /setrace [playerid/name] [teamid]"); if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xAFAFAFAA, "This player is not connected."); SetPlayerTeam(pID, tID); return SendClientMessage(playerid,0xAFAFAFAA, "Changed the player's race"); }
COMMAND:vampirebite(playerid, params[])
{
new
Player;
if(sscanf(params, "u", Player)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /vampirebite [playerid/name]");
if(Player != INVALID_PLAYER_ID) {
new Float:hp;
GetPlayerHealth(Player, hp);
SetPlayerHealth(Player, hp=-30);
}
else return SendClientMessage(playerid, 0xAFAFAFAA, "That player is currently not connected.");
return 1;
}
COMMAND:setrace(playerid, params[])
{
new
Player,
TeamID;
if(sscanf(params, "ud", Player, TeamID)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /setrace [playerid/name] [teamid]");
if(IsPlayerAdmin(playerid)) {
if(Player != INVALID_PLAYER_ID) {
SetPlayerTeam(Player, TeamID);
SendClientMessage(playerid,0xAFAFAFAA, "Changed the player's race");
}
else return SendClientMessage(playerid, 0xAFAFAFAA, "This player is not connected.");
}
else return SendClientMessage(playerid, 0xAFAFAFAA, "You need to be an rcon administrator to use this command");
return 1;
}
stock My_Function()
{
return printf("Hello, My_Function() was called!");
}
new Array[4];
Array[0] = 555;
Array[1] = 444;
Array[2] = 467;
Array[3] = 488;
printf("Array0:%d, Array1:%d, Array2:%d, Array3:%d", Array[0], Array[1], Array[2], Array[3]);
new Team[MAX_PLAYERS]; // MAX_PLAYERS is pre-defined as 500.
YES! It works, thank you so much! I'll give you credits for it of course, if you only knew how important that command is, thank you!
And I am rather new to scripting so I'm not that fluent, so thanks for that as well! |
COMMAND:vampirebite(playerid, params[])
{
new
Player;
if(sscanf(params, "u", Player)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage : /vampirebite [playerid/name]");
if(Player != INVALID_PLAYER_ID) {
if(gTeam[playerid] == 2) {
new Float:hp;
GetPlayerHealth(Player, hp);
SetPlayerHealth(Player, hp=-30);
}
else return SendClientMessage(playerid, 0xAFAFAFAA, "You need to be a vampire to use this command");
}
else return SendClientMessage(playerid, 0xAFAFAFAA, "That player is currently not connected.");
return 1;
}