22.01.2013, 02:24
can someone give me a code that say Loading oject,like you going to join a sever it say loading oject
guys i need helper system with this hcmd
/sethelper [id] /unsethelper [id] kick warn afk [TEXT] /helpers to see online helpers |
//Somewhere on top of your gamemode, near other global variables
new bool:playerHelper[MAX_PLAYERS];
CMD:sethelper(playerid, params[])
{
new pID, str[128];
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, -1, "Only admins can use this command.");
if(sscanf(params,"u", pID))
return SendClientMessage(playerid,-1,"USAGE: /sethelper [PlayerID]");
if(!IsPlayerConnected(pID))
return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
if(playerHelper[pID])
return SendClientMessage(playerid, -1, "Selected player is a helper already.");
new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
GetPlayerName(pID, name, sizeof name);
GetPlayerName(playerid, pName, sizeof pName);
playerHelper[pID] = true;
format(str, sizeof str, "Admin %s made you a helper.", pName);
SendClientMessage(pID, -1, str);
format(str, sizeof str, "You made %s a helper.", name);
SendClientMessage(playerid, -1, str);
return 1;
}
CMD:unsethelper(playerid, params[])
{
new pID, str[128];
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, -1, "Only admins can use this command.");
if(sscanf(params,"u", pID))
return SendClientMessage(playerid,-1,"USAGE: /unsethelper [PlayerID]");
if(!IsPlayerConnected(pID))
return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
if(!playerHelper[pID])
return SendClientMessage(playerid, -1, "Selected player is not helper.");
new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
GetPlayerName(pID, name, sizeof name);
GetPlayerName(playerid, pName, sizeof pName);
playerHelper[pID] = false;
format(str, sizeof str, "Admin %s made you a regular player.", pName);
SendClientMessage(pID, -1, str);
format(str, sizeof str, "You made %s a regular player.", name);
SendClientMessage(playerid, -1, str);
return 1;
}
CMD:hkick(playerid, params[])
{
new pID, str[128];
if(!playerHelper[playerid])
return SendClientMessage(playerid, -1, "Only helpers can use this command.");
if(sscanf(params,"u", pID))
return SendClientMessage(playerid,-1,"USAGE: /hkick [PlayerID]");
if(!IsPlayerConnected(pID))
return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
if(playerHelper[pID])
return SendClientMessage(playerid, -1, "Selected player is a helper too, you can't kick him / her.");
new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
GetPlayerName(pID, name, sizeof name);
GetPlayerName(playerid, pName, sizeof pName);
format(str, sizeof str, "Helper %s kicked you.", pName);
SendClientMessage(pID, -1, str);
format(str, sizeof str, "You kicked %s.", name);
SendClientMessage(playerid, -1, str);\
format(str, sizeof str, "Helper %s kicked player %s.", pName, name);
SendClientMessageToAll(-1, str);
Kick(pID);
return 1;
}
please i need something easy....
i need if players was DMING like that Player X Weapon Player Y >>>> like that please please please make it i need it fast... |
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
can someone give me a code that say Loading oject,like you going to join a sever it say loading oject
|
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, false);
GameTextForPlayer(playerid, "~w~Loading objects, please wait.", 3000, 3);
SetTimerEx("Unfreeze", 3000, false, "i", playerid);
return 1;
}
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid, true);
SendClientMessage(playerid, -1, "Objects loaded, you can now move again.");
return 1;
}
CMD:helpers(playerid, params[])
{
new count = 0, str[40], name[MAX_PLAYER_NAME+1];
SendClientMessage(playerid, -1, "Helpers ONLINE:");
for(new i; i<MAX_PLAYERS; i++)
{
if(playerHelper[i] == true)
{
GetPlayerName(i, name, sizeof name);
format(str, sizeof str, "Helper %s", name);
SendClientMessage(playerid, -1, str);
count ++;
}
}
if(count == 0) SendClientMessage(playerid, -1, "There are no helpers ONLINE at the moment.");
return 1;
}
pawn Code:
|
Hi I need commands /givemoney and /sethealth the first one yo give $ to a player being admin and the other one to give health to a player hooo and please use strcmp command processor. Thank you!
|
CMD:givemoney(playerid, params[])
{
new targetid,type,string[128];
if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");
GivePlayerCash(targetid, type);
format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
SendAdminMessage(COLOR_YELLOW,string);
return 1;
}
Here you Go. For /givemoney. Enjoy!
PHP Code:
Rep if i helped you |
Originally Posted by bathusin2343858
Here you Go. For /givemoney. Enjoy!
PHP Code:
Rep if i helped you |
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/givemoney", true))
{
new tmp[128], targetid, type, string[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
targetid = strval( tmp );
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
type = strtok(cmdtext, idx);
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");
GivePlayerCash(targetid, type);
format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
SendAdminMessage(COLOR_YELLOW,string);
return 1;
}
For first, why do you want to change that, ZCMD is more faster than strcmp..
Whatever.. You need this function: pawn Code:
|