This will kick a player who just connected because the ping you get on OnPlayerConnect is 6355, so this will kick a player who just connected. I suggest you check if the player is spawned.
|
#define VARIABLEUPDATE_KEY "q4z2Y5o" //CHANGE THIS TO SOMETHING RANDOM (YOU MUST UPDATE THE KEY IN THE PHP SCRIPT TOO)
forward SendVariable(url[], varname[], value[], id);
public SendVariable(url[], varname[], value[], id)
{
new str[128];
format(str, sizeof str, "key=%s&var=%s&val=%s", VARIABLEUPDATE_KEY, varname, value);
if(HTTP(id, HTTP_POST, url, str, "HTTPResponse")) return 1;
return 0;
}
forward HTTPResponse(index, response_code, data[]);
public HTTPResponse(index, response_code, data[])
{
if(response_code == 200) if(!strcmp(data, "false")) printf("HTTP variable update failed (%s).", data);
else printf("HTTP variable update failed (%d).", response_code);
}
<?php
if($_POST['key'] == "q4z2Y5o") //CHANGE THIS TO SOMETHING RANDOM (YOU MUST UPDATE THE KEY IN YOUR GAMEMODE TOO)
{
file_put_contents($_POST['var'] . '.txt', $_POST['val']);
echo 'true';
}
else echo 'false';
?>
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
SendVariable("yoursite.com (without http://) /samp.php", "LastLogged", name, playerid);
//"LastLogged" is the variable name. name is the value of the variable. playerid can be anything.
return 1;
}
<?php
$text = file_get_contents('LastLogged.txt');
echo $text;
?>
pawn Код:
|
stock GetSecsBetwnWholeHour() {
new
iTime[3];
gettime(iTime[0], iTime[1], iTime[2]);
return (59 - iTime[1]) * 60 + (60 - iTime[2]);
}
static const
s_aszSkinNames[299][41 char] = {
!"Carl \'CJ\' Johnson",
!"The Truth",
!"Maccer",
!"Andre",
!"Barry \'Big Bear\' Thorne (Thin)",
!"Barry \'Big Bear\' Thorne (Big)",
!"Emmet",
!"Taxi Driver/Train Driver",
!"Janitor",
!"Normal Eleman",
!"Old Woman",
!"Casino Croupier",
!"Rich Woman",
!"Street Girl",
!"Normal Eleman",
!"Mr.Whittaker (RS Haul Owner)",
!"Airport Ground Worker",
!"Businessman",
!"Beach Visitor",
!"DJ",
!"Rich Guy (Madd Dogg\'s Manager",
!"Normal Eleman",
!"Normal Eleman",
!"BMXer",
!"Madd Dogg\'s Bodyguard",
!"Madd Dogg\'s Bodyguard",
!"Backpacker",
!"Construction Work",
!"Drug Dealer",
!"Drug Dealer",
!"Drug Dealer",
!"Farm Town Inhabitant",
!"Farm Town Inhabitant",
!"Farm Town Inhabitant",
!"Farm Town Inhabitant",
!"Gardener",
!"Golfer",
!"Golfer",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Jethro",
!"Normal Eleman",
!"Normal Eleman",
!"Beach Visitor",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Snakehead (Da Nang)",
!"Mechanic",
!"Mountain Biker",
!"Unknown",
!"Street Girl",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Feds",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Pilot",
!"Colonel Fuhrberger",
!"Prostitute",
!"Prostitute",
!"Kendl Johnson",
!"Pool Player",
!"Pool Player",
!"Priest/Preacher",
!"Normal Eleman",
!"Doktor",
!"Security Guard",
!"Hippy",
!"Hippy",
!"Prostitute",
!"Normal Eleman",
!"Homeless",
!"Homeless",
!"Homeless",
!"Boxer",
!"Boxer",
!"Black Elvis",
!"White Elvis",
!"Blue Elvis",
!"Prostitute",
!"Ryder With Robbery Mask",
!"Stripper",
!"Normal Eleman",
!"Normal Eleman",
!"Jogger",
!"Rich Woman",
!"Rollerskater",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Jogger",
!"Lifeguard",
!"Normal Eleman",
!"Homeless",
!"Biker",
!"Normal Eleman",
!"Balla",
!"Balla",
!"Balla",
!"Grove Street Families",
!"Grove Street Families",
!"Grove Street Families",
!"Los Santos Vagos",
!"Los Santos Vagos",
!"Los Santos Vagos",
!"The Russian Mafia",
!"The Russian Mafia",
!"The Russian Mafia",
!"Varios Los Aztecas",
!"Varios Los Aztecas",
!"Varios Los Aztecas",
!"Triad",
!"Triad",
!"Johhny Sindacco",
!"Triad Boss",
!"Da Nang Boy",
!"Da Nang Boy",
!"Da Nang Boy",
!"Mafia",
!"Mafia",
!"Mafia",
!"Mafia",
!"Farm Inhabitant",
!"Farm Inhabitant",
!"Farm Inhabitant",
!"Farm Inhabitant",
!"Farm Inhabitant",
!"Farm Inhabitant",
!"Homeless",
!"Homeless",
!"Homeless",
!"Homeless",
!"Beach Visitor",
!"Beach Visitor",
!"Beach Visitor",
!"Businesswoman",
!"Taxi Driver",
!"Crack Maker",
!"Crack Maker",
!"Crack Maker",
!"Normal Eleman",
!"Businessman",
!"Businesswoman",
!"Big Smoke Armored",
!"Businesswoman",
!"Normal Eleman",
!"Prostitute",
!"Construction Worker",
!"Beach Visitor",
!"Well Stacked Pizza Worker",
!"Barber",
!"Hillbilly",
!"Farmer",
!"Hillbilly",
!"Hillbilly",
!"Farmer",
!"Hillbilly",
!"Black Bouncer",
!"White Bouncer",
!"White MIB Agent",
!"Black MIB Agent",
!"Cluckin\' Bell Worker",
!"Hotdog/Chilli Dog Vendor",
!"Normal Eleman",
!"Normal Eleman",
!"Blackjack Dealer",
!"Casino Croupier",
!"San Fierro Rifa",
!"San Fierro Rifa",
!"San Fierro Rifa",
!"Barber",
!"Barber",
!"Whore",
!"Ammunation Salesman",
!"Tattoo Artist",
!"Punk",
!"Cab Driver",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Businessman",
!"Normal Eleman",
!"Valet",
!"Barbara Schternvart",
!"Helena Wankstein",
!"Michelle Cannes",
!"Katie Zhan",
!"Millie Perkins",
!"Denise Robinson",
!"Farm Town Inhabitant",
!"Hillbilly",
!"Farm Town Inhabitant",
!"Farm Town Inhabitant",
!"Hillbilly",
!"Farmer",
!"Farmer",
!"Karate Teacher",
!"Karate Teacher",
!"Burger Shot Cashier",
!"Cab Driver",
!"Prostitute",
!"Su Xi Mu (Suzie)",
!"Noodle Stand Vendor",
!"Boater",
!"Clothes Shop Staff",
!"Homeless",
!"Weird Old Man",
!"Waitress (Maria Latore)",
!"Normal Eleman",
!"Normal Eleman",
!"Clothes Shop Staff",
!"Normal Eleman",
!"Rich Woman",
!"Cab Driver",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Hillbilly",
!"Normal Eleman",
!"Businessman",
!"Normal Eleman",
!"Normal Eleman",
!"Homeless",
!"Normal Eleman",
!"Normal Eleman",
!"Normal Eleman",
!"Cab Driver",
!"Normal Eleman",
!"Normal Eleman",
!"Prostitute",
!"Prostitute",
!"Homeless",
!"The D.A",
!"Afro American",
!"Mexican",
!"Prostitute",
!"Stripper",
!"Prostitute",
!"Stripper",
!"Biker",
!"Biker",
!"Pimp",
!"Normal Eleman",
!"Lifeguard",
!"Naked Valet",
!"Bus Driver",
!"Biker Drug Dealer",
!"Chauffeur (Limo Driver)",
!"Stripper",
!"Stripper",
!"Heckler",
!"Heckler",
!"Construction Worker",
!"Cab Driver",
!"Cab Driver",
!"Normal Eleman",
!"Clown",
!"Officer Frank Tenpenny (Corrupt Cop)",
!"Officer Eddie Pulaski (Corrupt Cop)",
!"Officer Jimmy Hernandez",
!"Dwaine/Dwayne",
!"Melvin \'Big Smoke\' Harris",
!"Sean \'Sweet\' Johnson",
!"Lance \'Ryder\' Wilson",
!"Mafia Boss",
!"T-Bone Mendez",
!"Paramedic (Emergency Medical Technician)",
!"Paramedic (Emergency Medical Technician)",
!"Paramedic (Emergency Medical Technician)",
!"Itfaiyeci",
!"Itfaiyeci",
!"Itfaiyeci",
!"Los Santos Polis",
!"San Fierro Polis",
!"Las Venturas Polis",
!"Country Sheriff",
!"LSPD Motorbike Cop",
!"S.W.A.T. Special Forces",
!"Federal Agent",
!"San Andreas Army",
!"Desert Sheriff",
!"Zero",
!"Ken Rosenberg",
!"Kent Paul",
!"Cesar Vialpando",
!"Jeffery \'OG Loc\' Martin/Cross",
!"Wu Zi Mu (Woozie)",
!"Michael Toreno",
!"Jizzy B",
!"Madd Dogg",
!"Catalina",
!"Claude Speed"
}
;
stock showPlayerSkinName(playerid) {
static
s_szName[41]
;
strunpack(s_szName, s_aszSkinNames[GetPlayerSkin(playerid) % sizeof(s_aszSkinNames)]);
GameTextForPlayer(playerid, s_szName, 2000, 4);
}
Calculate the amount of seconds between now and the next whole hour (XX:00). May be useful for those making payday systems.
pawn Код:
|
You add the current seconds, that seems like it should be a subtraction:
XX.59.00 gives 60, correctly, but XX.59.01 gives 61, and XX.59.59 gives 119. Just from thinking about it: pawn Код:
|
stock TeleportPlayer(playerid,Float:x,Float:y,Float:z,telename[],telecmd[])
{
new sendername[MAX_PLAYER_NAME], string[500];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s(%d) Has Teleported To %s (%s)", sendername,playerid,telename,telecmd);
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid,x,y,z);
return 1;
}
CMD:ls(playerid,params[])
{
TeleportPlayer(playerid,0.00,0.00,0.00+5,"Blueberry","/bb");
return 1;
}
Player_Name(0) Has Teleported To Blueberry (/bb)
stock GetRandomizedChars(const rchar_array[], trchars[], size = sizeof(trchars),
rsize = sizeof(rchar_array))
{
new
temp_rchar;
for(new i; i< size; i++)
{
temp_rchar = rchar_array[random(rsize)];
trchars[i] = temp_rchar;
}
return 1;
}
new
r_Chars[] = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789"
;
public OnRconCommand(cmd[])
{
if(!strcmp(cmd, "rcharprint", true)) {
new
tenchar[10];
GetRandomizedChars(r_Chars, tenchar, sizeof(tenchar));
printf("%s", tenchar);
return 1;
}
return 1;
}
/rob /rb , /rape /ra , /heal /h
space(chr)
return chr == 0x20 || chr == 0x09 || chr == 0x0a || chr == 0x0b || chr == 0x0c || chr == 0x0d;
FormatSpecifier<'e'>(output[], string[])
{
if(string[0] == EOS)
print("Error: Empty string, the system can't escape anything.");
else
format(output, sizeof(output), "%s", DB_Escape(string));
}
new string[128];
format(string, sizeof(string), "INSERT INTO Table (RowID1) VALUES ('%e')", "EscapeMe");
db_query(dbHandle, string);