CMD:eject(playerid, params[])
{
new uID;
if(sscanf(params, "u", uID)) return SendClientMessage(playerid, -1,"Usage: /eject [playerid]");
if(!IsPlayerConnected(uID)) return SendClientMessage(playerid, -1, "ERROR: This player isn't connected");
if(!IsPlayerInAnyVehicle(uID)) return SendClientMessage(playerid, -1, "ERROR: The player isn't in any vehicle");
new Float:xposs, Float:y, Float:z;
RemovePlayerFromVehicle(uID);
GetPlayerPos(uID, xposs, y, z);
SetPlayerPos(uID, xposs, y, z + 3);
SendClientMessage(uID, -1, "You have been ejected from the vehcile");
SendClientMessage(playerid, -1, "Player ejected");
return 1;
}
if(!strcmp(cmdtext, "/eject", true))
{
new tmp[128], uID;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1,"Usage: /eject [playerid]");
uID = strval(tmp);
if(!IsPlayerConnected(uID)) return SendClientMessage(playerid, -1, "ERROR: This player isn't connected");
if(!IsPlayerInAnyVehicle(uID)) return SendClientMessage(playerid, -1, "ERROR: The player isn't in any vehicle");
new Float:xposs, Float:y, Float:z;
RemovePlayerFromVehicle(uID);
GetPlayerPos(uID, xposs, y, z);
SetPlayerPos(uID, xposs, y, z + 3);
SendClientMessage(uID, -1, "You have been ejected from the vehcile");
SendClientMessage(playerid, -1, "Player ejected");
return 1;
}
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);
|
ZCMD:
pawn Code:
pawn Code:
This function: pawn Code:
pawn Code:
Depends on what Save System are you using.. |
|
If anyone can create a command for me to hide/show http://i50.tinypic.com/28akifl.png these commands when some player write something it shows on admins chat, so it makes big spam for admins.
pls i need fest help ![]() |
// Send the command to all admins so they can see it SendAdminText(playerid, "/bank", params);
|
Go to your PPC_PlayerCommands.inc
if you don't wanna the Admin Can see Command a player who type a command Code:
// Send the command to all admins so they can see it SendAdminText(playerid, "/bank", params); |
|
looking for a countdown filterscript. that starts when gamemode starts
i dont want to do /count cmd it just automaticly starts counting down from 5 min to 0 with a textdraw showing countdown to all players i will pay... or you can be a admin on my server add andrewgrob2012 .. on skype or just visit my server below |
new CountMinutes = 4;
new CountSeconds = 60;
new CountTimer;
OnGameModeInit()
{
CountTimer = SetTimer("CountDown", 1000, true);
return 1;
}
forward CountDown();
public CountDown()
{
new str[50];
CountSeconds --;
if(Seconds < 1 && CountMinutes > 0)
{
CountSeconds = 60;
CountMinutes --;
format(str, sizeof str, "Time left: %d:%d", CountMinutes, CountSeconds);
GameTextForAll(str, 1000, 1);
}
else if(CountSeconds < 1 && CountMinutes == 0)
{
KillTimer(CountTimer);
CountMinutes = 4;
CountSeconds = 59;
SendClientMessageToAll(-1, "Countdown finished.");
}
return 1;
}
dcmd_resetstats(playerid,params[])
{
#pragma unused params
if(AccInfo[playerid][LoggedIn] == 1)
{
dUserSetINT(PlayerName2(playerid)).("oldkills",AccInfo[playerid][Kills]);
dUserSetINT(PlayerName2(playerid)).("olddeaths",AccInfo[playerid][Deaths]);
AccInfo[playerid][Kills] = 0;
AccInfo[playerid][Deaths] = 0;
dUserSetINT(PlayerName2(playerid)).("Kills",AccInfo[playerid][Kills]);
dUserSetINT(PlayerName2(playerid)).("Deaths",AccInfo[playerid][Deaths]);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return SendClientMessage(playerid,yellow,"|- You have Successfully reset your Stats! -|");
}
else return SendClientMessage(playerid,red, "ERROR: You must have an account to use this command");
}
dcmd_stats(playerid,params[])
{
new string[128];
new pDeaths;
new player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1))
{
TotalGameTime(player1, h, m, s);
if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
else pDeaths = AccInfo[player1][Deaths];
format(string, sizeof(string), "|- %s's Statistics -|",PlayerName2(player1));
SendClientMessage(playerid, green, string);
format(string, sizeof(string), "Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d] | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return SendClientMessage(playerid, green, string);
} else
return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}
|
Well, I can show you a pretty simple example, you can modify it as you please to fit your server and your requirements.
pawn Код:
![]() |
CMD:derby(playerid, params[])
{
new str7[128], player8[MAX_PLAYER_NAME];
GetPlayerName(playerid, player8, sizeof(player8));
format(str7,sizeof(str7),"%s teleportis end derbysse [/derby]",player8);
SendClientMessageToAll(COLOR_GREEN,str7);
new rand = random(sizeof(D1Rand));
SetPlayerPos(playerid, D1Rand[rand][0], D1Rand[rand][1], D1Rand[rand][2]);
SendClientMessage(playerid, COLOR_NGREEN,"Teleportisid end derbysse!");
ResetPlayerWeapons(playerid);
nocmd[playerid] = 1;
return 1;
}
|
Hello
i need a savestats cmd for luxadmin see this : Код:
dcmd_resetstats(playerid,params[])
{
#pragma unused params
if(AccInfo[playerid][LoggedIn] == 1)
{
dUserSetINT(PlayerName2(playerid)).("oldkills",AccInfo[playerid][Kills]);
dUserSetINT(PlayerName2(playerid)).("olddeaths",AccInfo[playerid][Deaths]);
AccInfo[playerid][Kills] = 0;
AccInfo[playerid][Deaths] = 0;
dUserSetINT(PlayerName2(playerid)).("Kills",AccInfo[playerid][Kills]);
dUserSetINT(PlayerName2(playerid)).("Deaths",AccInfo[playerid][Deaths]);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return SendClientMessage(playerid,yellow,"|- You have Successfully reset your Stats! -|");
}
else return SendClientMessage(playerid,red, "ERROR: You must have an account to use this command");
}
dcmd_stats(playerid,params[])
{
new string[128];
new pDeaths;
new player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1))
{
TotalGameTime(player1, h, m, s);
if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
else pDeaths = AccInfo[player1][Deaths];
format(string, sizeof(string), "|- %s's Statistics -|",PlayerName2(player1));
SendClientMessage(playerid, green, string);
format(string, sizeof(string), "Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d] | Time: [%d] hrs [%d] mins [%d] secs |", AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return SendClientMessage(playerid, green, string);
} else
return SendClientMessage(playerid, red, "ERROR: Player Not Connected!");
}
tnx gift : 2 rep |
SavePlayerStats(playerid)
{
dUserSetINT(PlayerName2(playerid)).("Money",GetPlayerMoney(playerid));
dUserSetINT(PlayerName2(playerid)).("Kills",AccInfo[playerid][Kills]);
dUserSetINT(PlayerName2(playerid)).("Deaths",AccInfo[playerid][Deaths]);
dUserSetINT(PlayerName2(playerid)).("WantedLevel",GetPlayerWantedLevel(playerid));
#if SaveScore == true
dUserSetINT(PlayerName2(playerid)).("Score",GetPlayerScore(playerid));
#endif
new h, m, s;
TotalGameTime(playerid, h, m, s);
dUserSetINT(PlayerName2(playerid)).("Hours", h);
dUserSetINT(PlayerName2(playerid)).("Minutes", m);
dUserSetINT(PlayerName2(playerid)).("Seconds", s);
new Float:x,Float:y,Float:z, interior;
GetPlayerPos(playerid,x,y,z);
interior = GetPlayerInterior(playerid);
dUserSetINT(PlayerName2(playerid)).("x1",floatround(x));
dUserSetINT(PlayerName2(playerid)).("y1",floatround(y));
dUserSetINT(PlayerName2(playerid)).("z1",floatround(z));
dUserSetINT(PlayerName2(playerid)).("interior1",interior);
new weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6;
GetPlayerWeaponData(playerid,2,weap1,ammo1);
GetPlayerWeaponData(playerid,3,weap2,ammo2);
GetPlayerWeaponData(playerid,4,weap3,ammo3);
GetPlayerWeaponData(playerid,5,weap4,ammo4);
GetPlayerWeaponData(playerid,6,weap5,ammo5);
GetPlayerWeaponData(playerid,7,weap6,ammo6);
dUserSetINT(PlayerName2(playerid)).("Weapon1",weap1);
dUserSetINT(PlayerName2(playerid)).("Weapon1Ammo",ammo1);
dUserSetINT(PlayerName2(playerid)).("Weapon2",weap2);
dUserSetINT(PlayerName2(playerid)).("Weapon2Ammo",ammo2);
dUserSetINT(PlayerName2(playerid)).("Weapon3",weap3);
dUserSetINT(PlayerName2(playerid)).("Weapon3Ammo",ammo3);
dUserSetINT(PlayerName2(playerid)).("Weapon4",weap4);
dUserSetINT(PlayerName2(playerid)).("Weapon4Ammo",ammo4);
dUserSetINT(PlayerName2(playerid)).("Weapon5",weap5);
dUserSetINT(PlayerName2(playerid)).("Weapon5Ammo",ammo5);
dUserSetINT(PlayerName2(playerid)).("Weapon6",weap6);
dUserSetINT(PlayerName2(playerid)).("Weapon6Ammo",ammo6);
new Float:health;
GetPlayerHealth(playerid, Float:health);
new Float:armour;
GetPlayerArmour(playerid, Float:armour);
new year,month,day;
getdate(year, month, day);
new strdate[20];
format(strdate, sizeof(strdate), "%d.%d.%d",day,month,year);
new file[256];
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)) );
dUserSetINT(PlayerName2(playerid)).("Health",floatround(health));
dUserSetINT(PlayerName2(playerid)).("Armour",floatround(armour));
dini_Set(file,"LastOn",strdate);
dUserSetINT(PlayerName2(playerid)).("Loggedin",0);
dUserSetINT(PlayerName2(playerid)).("TimesOnServer",(dUserINT(PlayerName2(playerid)).("TimesOnServer"))+1);
}
dcmd_savestats(playerid, params[])
{
#pragma unused params
SavePlayerStats(playerid);
SendClientMessage(playerid, -1, "Your statistics have been saved!");
return 1;
}
|
I need a derby system, heres my command below. I need that the limit is 4 people, i have 4 cars. And the last one in the derby, who has smashed all cars gets 10'000$, really need it.
Код:
CMD:derby(playerid, params[])
{
new str7[128], player8[MAX_PLAYER_NAME];
GetPlayerName(playerid, player8, sizeof(player8));
format(str7,sizeof(str7),"%s teleportis end derbysse [/derby]",player8);
SendClientMessageToAll(COLOR_GREEN,str7);
new rand = random(sizeof(D1Rand));
SetPlayerPos(playerid, D1Rand[rand][0], D1Rand[rand][1], D1Rand[rand][2]);
SendClientMessage(playerid, COLOR_NGREEN,"Teleportisid end derbysse!");
ResetPlayerWeapons(playerid);
nocmd[playerid] = 1;
return 1;
}
|
|
Well that encode and decode thing
ex When player joins it sets his name in the file as Madafaka_00Pro or sometimes Madafaka_14Pro ... |