Lil' script prob -
ikbenremco - 21.04.2012
Hey I am trieng to make admins commands that give global stuffs. here an example
Код:
CMD:tupacforall(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 1) {
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://www.t72supra.com/Changes.mp3");
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "Music: %s has started the Song Tupac-Changes", szPlayerName);
SendClientMessageToAll(COLOR_LIGHTRED, szMessage);
}
}
}
Код:
CMD:armourforall(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 1) {
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerArmour(i, 100);
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "Admin %s refilled everyone's Armour!", szPlayerName);
SendClientMessageToAll(COLOR_LIGHTRED, szMessage);
}
}
}
CMD:ahforall(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 1) {
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerArmour(i, 100);
SetPlayerHealth(i, 100);
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "Admin %s refilled everyone's Armour And Health", szPlayerName);
SendClientMessageToAll(COLOR_LIGHTRED, szMessage);
}
}
}
CMD:weaponforall(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 1) {
for(new i = 0; i < MAX_PLAYERS; i++)
{
givePlayerValidWeapon(i, 24);
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "Admin %s Gave everyone a DEAGLE ", szPlayerName);
SendClientMessageToAll(COLOR_LIGHTRED, szMessage);
}
}
}
And with the weapon for all It doenst give anyone a weapon,
And with all the others the strings spams the whole chatbox please help
Код:
CMD:invite(playerid, params[]) {
if(playerVariables[playerid][pGroup] >= 1 && playerVariables[playerid][pGroupRank] >= 5) {
new
userID;
if(sscanf(params, "u", userID)) {
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/invite [playerid]");
}
else {
if(!IsPlayerConnected(userID)) return SendClientMessage(playerid, COLOR_GREY, "The specified userID/name is not connected.");
else if(playerVariables[userID][pGroup] > 0) return SendClientMessage(playerid, COLOR_GREY, "That player is already in a group.");
if(playerVariables[userID][pLevel] < assetVariables[2][aAssetValue]) {
format(szMessage, sizeof(szMessage), "You can't invite a player below level %d.", assetVariables[2][aAssetValue]);
SendClientMessage(playerid, COLOR_GREY, szMessage);
format(szMessage, sizeof(szMessage), "You have been invited to a group, but you can't accept the invite. You must be at least level %d, you've got %d levels to go!", assetVariables[2][aAssetValue], assetVariables[2][aAssetValue]-playerVariables[userID][pLevel]);
return SendClientMessage(playerid, COLOR_GREY, szMessage);
}
GetPlayerName(userID, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "You have invited %s to join your group.", szPlayerName);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "%s has invited you to join group %s (to accept the invitation, type '/accept invite').", szPlayerName, groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
SendClientMessage(userID, COLOR_NICESKY, szMessage);
SetPVarInt(userID, "invID", playerVariables[playerid][pGroup]); // Storing in a PVar as it's something that won't be used frequently, saving memory. Also, keeping the variable names short, as they're stored in memory and literally kill!!1
}
}
return 1;
}
is bugged aswell it says always this you have been invited to a group, but you can't accept the invite. You must be at least level %d, you've got %d levels to go!
but when I am lvl 3 + the suspect it aint working ;s please help
Re: Lil' script prob -
Deduction - 22.04.2012
Every bother returning the commands?
Re: Lil' script prob -
ikbenremco - 22.04.2012
I am just starting to scripting that's why i'm asking some help
and returning them doenst work :S