pawn Код:
//INFO==========================================================================/*
Date started: 30-11-2013
Time: 21:53 PM
Creator: Voxel
Server Name: Terminators VS Predators
Database: SQLite
Version: 0.1 Alpha
Website: http://www.sa-mp.com
*///INFO==========================================================================/*
Main: Voxel
Laser Shoot: Rudy_
*///INCLUDES======================================================================#include <a_samp>#include <zcmd>#include <foreach>#include <streamer>//DEFINES=======================================================================#define MAX_INI_ENTRY_TEXT 80//INFO#define Web "www.sa-mp.com"#define Version "v0.1"#define Creator "Voxel"#define Name "TVSP""#define CName "SAMP"#define chat "{FFFFFF}*"//COLORS#define COL_WHITE "{FFFFFF}"#define COL_GREY "{C3C3C3}"#define COL_GREEN "{37DB45}"#define COL_RED "{F81414}"#define COL_YELLOW "{F3FF02}"#define COL_ORANGE "{F9B857}"#define COL_BLUE "{0049FF}"#define COL_PINK "{FF00EA}"#define COL_LIGHTBLUE "{00C0FF}"#define COL_LGREEN "{C9FFAB}"//TEAM COLORS#define TERMINATOR "{FF0000}"#define PREDATOR "{00DDFF}"//NATIVES=======================================================================native WP_Hash
(buffer
[], len,
const str
[]);
//ENUMARATORS===================================================================enum USER_DATA
{ USER_ID,
USER_NAME
[MAX_PLAYER_NAME
],
USER_PASSWORD
[129],
USER_ADMIN,
USER_VIP,
USER_MONEY,
USER_SCORE,
USER_KILLS,
USER_DEATHS,
bool: USER_LOGGED_IN
};
//GLOBAL VARIABLES==============================================================//DATABASEnew User
[MAX_PLAYERS
][USER_DATA
];
new DB: Database;
//TEAMSnew term
[MAX_PLAYERS
];
new pred
[MAX_PLAYERS
];
//LOGIN SCREENnew Text:login0;
new Text:login1;
new Text:login2;
new Text:login3;
//LASERnew FireShot
[MAX_PLAYERS
];
new gRocketObj
[MAX_PLAYERS
];
//MAIN==========================================================================main
(){ print("=====================================");
print("| TERMINATORS VS PREDATORS |");
print("| *INITIATED* |");
print("| Version: v0.1 |");
print("| Creator: Voxel |");
print("=====================================");
}public OnGameModeInit
(){ SetGameModeText
("TVSP"Version
"");
Database
= db_open
("server.db");
db_query
(Database,
"CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), admin INTEGER DEFAULT 0 NOT NULL, vip INTEGER DEFAULT 0 NOT NULL, money INTEGER DEFAULT 0 NOT NULL, score INTEGER DEFAULT 0 NOT NULL, kills INTEGER DEFAULT 0 NOT NULL, deaths INTEGER DEFAULT 0 NOT NULL)");
AddPlayerClass
(1,
2528.9143,
-1667.7504,
15.1689,
91.2860,
0,
0,
0,
0,
0,
0);
//LOGIN SCREEN login0
= TextDrawCreate
(641.619079,
1.500000,
"usebox");
TextDrawLetterSize
(login0,
0.000000,
49.413703);
TextDrawTextSize
(login0,
-2.000000,
0.000000);
TextDrawAlignment
(login0,
1);
TextDrawColor
(login0,
0);
TextDrawUseBox
(login0, true
);
TextDrawBoxColor
(login0,
255);
TextDrawSetShadow
(login0,
0);
TextDrawSetOutline
(login0,
0);
TextDrawFont
(login0,
0);
login1
= TextDrawCreate
(142.857116,
20.906671,
"SA-MP");
TextDrawLetterSize
(login1,
0.930762,
4.625065);
TextDrawAlignment
(login1,
1);
TextDrawColor
(login1,
-2147483393);
TextDrawSetShadow
(login1,
0);
TextDrawSetOutline
(login1,
1);
TextDrawBackgroundColor
(login1,
-5963521);
TextDrawFont
(login1,
2);
TextDrawSetProportional
(login1,
1);
login2
= TextDrawCreate
(201.523666,
71.253318,
"Terminators VS Predators");
TextDrawLetterSize
(login2,
0.696095,
3.477333);
TextDrawAlignment
(login2,
1);
TextDrawColor
(login2,
-5963521);
TextDrawSetShadow
(login2,
0);
TextDrawSetOutline
(login2,
1);
TextDrawBackgroundColor
(login2,
-2147483393);
TextDrawFont
(login2,
2);
TextDrawSetProportional
(login2,
1);
login3
= TextDrawCreate
(177.523788,
56.746677,
"-");
TextDrawLetterSize
(login3,
21.241235,
2.043734);
TextDrawAlignment
(login3,
1);
TextDrawColor
(login3,
-5963521);
TextDrawSetShadow
(login3,
0);
TextDrawSetOutline
(login3,
1);
TextDrawBackgroundColor
(login3,
-2147483393);
TextDrawFont
(login3,
1);
TextDrawSetProportional
(login3,
1);
return 1;
}public OnGameModeExit
(){ db_close
(Database
);
print("=====================================");
print("| TERMINATORS VS PREDATORS |");
print("| *SHUT DOWN* |");
print("| Version: v0.1 |");
print("| Creator: Voxel |");
print("=====================================");
TextDrawDestroy
(login0
);
TextDrawDestroy
(login1
);
TextDrawDestroy
(login2
);
TextDrawDestroy
(login3
);
return 1;
}public OnPlayerRequestClass
(playerid, classid
){ return 1;
}public OnPlayerConnect
(playerid
){ TextDrawShowForPlayer
(playerid, login0
);
TextDrawShowForPlayer
(playerid, login1
);
TextDrawShowForPlayer
(playerid, login2
);
TextDrawShowForPlayer
(playerid, login3
);
SendClientMessage
(playerid,
-1,
"Welcome to "TERMINATOR
"Terminator's"COL_WHITE
" VS "PREDATOR
"Predator's!");
for(new i; i
< _: USER_DATA;
++i
) User
[playerid
][USER_DATA: i
] = 0;
GetPlayerName
(playerid, User
[playerid
][USER_NAME
], MAX_PLAYER_NAME
);
new Query
[71],
DBResult: Result;
format(Query,
sizeof(Query
),
"SELECT password FROM users WHERE username = '%s' LIMIT 0, 1", DB_Escape
(User
[playerid
][USER_NAME
]));
Result
= db_query
(Database, Query
);
if(db_num_rows
(Result
)) { db_get_field_assoc
(Result,
"password", User
[playerid
][USER_PASSWORD
],
129);
ShowPlayerDialog
(playerid,
0, DIALOG_STYLE_PASSWORD,
""COL_BLUE
"TVSP"COL_WHITE
" Login pannel",
""chat
" Please login to play on "COL_BLUE
"Terminators VS Predators\n"COL_WHITE
"Enter your "COL_BLUE
"password"COL_WHITE
":",
"Login",
"Exit");
} else ShowPlayerDialog
(playerid,
1, DIALOG_STYLE_PASSWORD,
""COL_BLUE
"TVSP"COL_WHITE
" Register pannel",
""chat
" Please register to play on "COL_BLUE
"Terminators VS Predators\n"COL_WHITE
"Enter a "COL_BLUE
"password"COL_WHITE
":",
"Register",
"Exit");
db_free_result
(Result
);
return 1;
}public OnPlayerDisconnect
(playerid, reason
){ if(User
[playerid
][USER_LOGGED_IN
] == true
) { new Query
[128];
format(Query,
sizeof(Query
),
"UPDATE users SET admin = %d, vip = %d, money = %d, score = %d, kills = %d, deaths = %d WHERE username = '%s'", User
[playerid
][USER_ADMIN
], User
[playerid
][USER_VIP
], GetPlayerMoney
(playerid
), GetPlayerScore
(playerid
), User
[playerid
][USER_KILLS
], User
[playerid
][USER_DEATHS
], DB_Escape
(User
[playerid
][USER_NAME
]));
db_query
(Database, Query
);
} for(new i; i
< _: USER_DATA;
++i
) User
[playerid
][USER_DATA: i
] = 0;
return 1;
}public OnPlayerSpawn
(playerid
){ TextDrawHideForPlayer
(playerid, login0
);
TextDrawHideForPlayer
(playerid, login1
);
TextDrawHideForPlayer
(playerid, login2
);
TextDrawHideForPlayer
(playerid, login3
);
term
[playerid
] = 0;
pred
[playerid
] = 0;
SendClientMessage
(playerid,
-1,
""TERMINATOR
"__________________Terminator_________________");
SendClientMessage
(playerid,
-1,
"/terminatoron to become a terminator!");
SendClientMessage
(playerid,
-1,
"/terminatoroff to return back to a human!");
SendClientMessage
(playerid,
-1,
"/thelp to see all your terminator powers and commands!");
SendClientMessage
(playerid,
-1,
""PREDATOR
"__________________Predator___________________");
SendClientMessage
(playerid,
-1,
"/predatoron to become a terminator!");
SendClientMessage
(playerid,
-1,
"/predatoroff to return back to a human!");
SendClientMessage
(playerid,
-1,
"/phelp to see all your predator powers and commands!");
return 1;
}//PLAYER DEATH==================================================================public OnPlayerDeath
(playerid, killerid, reason
){ SendDeathMessage
(killerid, playerid, reason
);
if(term
[playerid
] == 1) { new string
[128];
PlayAudioStreamForPlayer
(playerid,
"http://files.mboxdrive.com/100003233014909/ill-be-back.mp3");
SendClientMessage
(playerid,
-1,
"You died!");
format(string,
sizeof(string
),
""TERMINATOR
"Terminator %s has died!",PlayerName
(playerid
),string
);
SendClientMessageToAll
(-1, string
);
User
[playerid
][USER_DEATHS
]++;
} else { new string
[128];
SendClientMessage
(playerid,
-1,
"You died!");
format(string,
sizeof(string
),
""PREDATOR
"Predator %s has died!",PlayerName
(playerid
),string
);
SendClientMessageToAll
(-1, string
);
User
[playerid
][USER_DEATHS
]++;
} if(killerid
!= INVALID_PLAYER_ID
) { User
[killerid
][USER_KILLS
]++;
} return 1;
}//KEY STATE CHANGE==============================================================public OnPlayerKeyStateChange
(playerid, newkeys, oldkeys
){ if(FireShot
[playerid
] == 0 && newkeys
& 4 && !IsValidObject
(gRocketObj
[playerid
])) { SetPlayerTime
(playerid,
0,
0);
new Float:x,
Float:y,
Float:z,
Float:r,
Float:dist
= 50.0,
Float:tmpang,
Float:tmpx,
Float:tmpy,
Float:tmpz;
FireShot
[playerid
] = 1;
SetTimerEx
("ShotFire",
1000,
0,
"i", playerid
);
GetPlayerPos
(playerid, x, y, z
);
GetPlayerFacingAngle
(playerid, r
);
new rand
= random(11);
switch(rand
) { case 0: gRocketObj
[playerid
] = CreateObject
(18647, x, y, z,
0,
0, r
);
case 1: gRocketObj
[playerid
] = CreateObject
(18648, x, y, z,
0,
0, r
);
case 2: gRocketObj
[playerid
] = CreateObject
(18649, x, y, z,
0,
0, r
);
case 3: gRocketObj
[playerid
] = CreateObject
(18650, x, y, z,
0,
0, r
);
case 4: gRocketObj
[playerid
] = CreateObject
(18651, x, y, z,
0,
0, r
);
case 5: gRocketObj
[playerid
] = CreateObject
(18652, x, y, z,
0,
0, r
);
} for(new i;i
<MAX_PLAYERS;i
++) { if(i
== playerid
)continue;
if(IsPlayerInRangeOfPoint
(i,
50.0, x, y, z
)) { GetPlayerPos
(i, tmpx, tmpy, tmpz
);
tmpang
= (90-atan2(tmpy
-y, tmpx
-x
));
if(tmpang
< 0)tmpang
= 360.0+tmpang;
tmpang
= 360.0 - tmpang;
if( floatabs(tmpang
-r
) < 5.0) { dist
= GetPlayerDistanceFromPoint
(i, x, y, z
);
} } } MoveObject
(gRocketObj
[playerid
],x
+ (dist
* floatsin(-r, degrees
)),y
+ (dist
* floatcos(-r, degrees
)),z,
100.0);
// Nice and fast! } if(term
[playerid
] == 1) { if (newkeys
& KEY_JUMP
) { new Float:SuperJump
[3];
GetPlayerVelocity
(playerid, SuperJump
[0], SuperJump
[1], SuperJump
[2]);
SetPlayerVelocity
(playerid, SuperJump
[0], SuperJump
[1], SuperJump
[2]+5);
} } if(pred
[playerid
] == 1) { if (newkeys
& KEY_JUMP
) { new Float:SuperJump
[3];
GetPlayerVelocity
(playerid, SuperJump
[0], SuperJump
[1], SuperJump
[2]);
SetPlayerVelocity
(playerid, SuperJump
[0], SuperJump
[1], SuperJump
[2]+10);
} }}//COMMANDS======================================================================CMD:thelp
(playerid, params
[]){ new str
[250];
strcat(str,
"As a Terminator you gain the following features:\n");
strcat(str,
"- Medium Jump (shift)\n");
strcat(str,
"- 100 Health\n");
strcat(str,
"- 100 Armour\n");
strcat(str,
"- Cool blue glasses\n");
strcat(str,
"- Cool blue laser eyes (/leyesoff /leyesonn)\n");
strcat(str,
"- A cool ass skin!\n");
strcat(str,
"- Commands: /predatoron /predatoroff /phelp /leyesoff /leyeson\n");
ShowPlayerDialog
(playerid,
100, DIALOG_STYLE_MSGBOX,
"Terminator help", str,
"Hell yeah!",
"");
return 1;
}CMD:phelp
(playerid, params
[]){ new str
[250];
strcat(str,
"As a Predator you gain the following features:\n");
strcat(str,
"- Super Jump (shift)\n");
strcat(str,
"- 100 Health\n");
strcat(str,
"- 50 Armour\n");
strcat(str,
"- Cool blue glasses\n");
strcat(str,
"- Cool red laser eyes (/leyesoff /leyesonn)\n");
strcat(str,
"- A cool ass skin!\n");
strcat(str,
"- Commands: /terminatoron /terminatoroff /thelp /leyesoff /leyeson\n");
ShowPlayerDialog
(playerid,
100, DIALOG_STYLE_MSGBOX,
"Predator help", str,
"Hell yeah!",
"");
return 1;
}CMD:leyesoff
(playerid, params
[]){ if(term
[playerid
] == 1) { RemovePlayerAttachedObject
(playerid,
1);
} if(pred
[playerid
] == 1) { RemovePlayerAttachedObject
(playerid,
2);
} return 1;
}CMD:leyeson
(playerid, params
[]){ if(term
[playerid
] == 1) { SetPlayerAttachedObject
(playerid,
1,
18643,
2,
0.088934,
0.023302,
-0.004153,
90.928329,
80.393875,
0.000000,
1.000000);
} if(pred
[playerid
] == 1) { SetPlayerAttachedObject
(playerid,
3,
18643,
2,
0.088934,
0.023302,
-0.004153,
90.928329,
80.393875,
0.000000,
1.000000);
} return 1;
}CMD:terminatoron
(playerid, params
[]){ if(term
[playerid
] == 1) { SendClientMessage
(playerid,
-1,
""TERMINATOR
"You are already a terminator!");
} else { term
[playerid
] = 1;
SetPlayerAttachedObject
(playerid,
0,
19006,
2,
0.088934,
0.023302,
-0.004153,
90.928329,
80.393875,
0.000000,
1.000000);
//red glasses SetPlayerAttachedObject
(playerid,
1,
18643,
2,
0.088934,
0.023302,
-0.004153,
90.928329,
80.393875,
0.000000,
1.000000);
//red laser SetPlayerSkin
(playerid,
164);
SetPlayerHealth
(playerid,
100);
SetPlayerArmour
(playerid,
100);
SetPlayerColor
(playerid, 0xFF0000
);
ResetPlayerWeapons
(playerid
);
GivePlayerWeapon
(playerid,
45,
1000000000);
GivePlayerWeapon
(playerid,
16,
1000000000);
GivePlayerWeapon
(playerid,
24,
1000000000);
GivePlayerWeapon
(playerid,
27,
1000000000);
GivePlayerWeapon
(playerid,
29,
1000000000);
GivePlayerWeapon
(playerid,
31,
1000000000);
GivePlayerWeapon
(playerid,
34,
1000000000);
GivePlayerWeapon
(playerid,
35,
1000000000);
GivePlayerWeapon
(playerid,
39,
1000000000);
new string
[128];
SendClientMessage
(playerid,
-1,
"You are now a terminator!");
format(string,
sizeof(string
),
""TERMINATOR
"%s is now a terminator!",PlayerName
(playerid
),string
);
SendClientMessageToAll
(-1, string
);
} return 1;
}CMD:predatoron
(playerid, params
[]){ if(pred
[playerid
] == 1) { SendClientMessage
(playerid,
-1,
""TERMINATOR
"You are already a predator!");
} else { pred
[playerid
] = 1;
new Float:posxx
[3];
GetPlayerPos
(playerid, posxx
[0], posxx
[1], posxx
[2]);
SetPlayerPos
(playerid, posxx
[0], posxx
[1], posxx
[2]+450);
SetPlayerAttachedObject
(playerid,
2,
19009,
2,
0.088934,
0.023302,
-0.004153,
90.928329,
80.393875,
0.000000,
1.000000);
//blue glasse SetPlayerAttachedObject
(playerid,
3,
19080,
2,
0.088934,
0.023302,
-0.004153,
90.928329,
80.393875,
0.000000,
1.000000);
//blue laser SetPlayerSkin
(playerid,
163);
SetPlayerHealth
(playerid,
100);
SetPlayerArmour
(playerid,
50);
SetPlayerColor
(playerid, 0x00DDFF
);
ResetPlayerWeapons
(playerid
);
GivePlayerWeapon
(playerid,
46,
1000000000);
GivePlayerWeapon
(playerid,
8,
1000000000);
GivePlayerWeapon
(playerid,
24,
1000000000);
new string
[128];
SendClientMessage
(playerid,
-1,
"You are now a predator!");
format(string,
sizeof(string
),
""PREDATOR
"%s is now a predator!",PlayerName
(playerid
),string
);
SendClientMessageToAll
(-1, string
);
GameTextForAll
("~h~~h~~h~~b~Predator drop~n~incommig!",
3000,
4);
} return 1;
}CMD:terminatoroff
(playerid, params
[]){ PlayAudioStreamForPlayer
(playerid,
"http://files.mboxdrive.com/100003233014909/ill-be-back.mp3");
term
[playerid
] = 0;
pred
[playerid
] = 0;
SetPlayerSkin
(playerid,
0);
ResetPlayerWeapons
(playerid
);
SetPlayerHealth
(playerid,
100);
SetPlayerArmour
(playerid,
0);
for(new i
=0; i
<MAX_PLAYER_ATTACHED_OBJECTS; i
++) { if(IsPlayerAttachedObjectSlotUsed
(playerid, i
)) RemovePlayerAttachedObject
(playerid, i
);
} return 1;
}CMD:predatoroff
(playerid, params
[]){ term
[playerid
] = 0;
pred
[playerid
] = 0;
SetPlayerSkin
(playerid,
0);
ResetPlayerWeapons
(playerid
);
SetPlayerHealth
(playerid,
100);
SetPlayerArmour
(playerid,
0);
for(new i
=0; i
<MAX_PLAYER_ATTACHED_OBJECTS; i
++) { if(IsPlayerAttachedObjectSlotUsed
(playerid, i
)) RemovePlayerAttachedObject
(playerid, i
);
} return 1;
}CMD:car
(playerid, params
[]){ new Float:up
[3], carid;
GetPlayerPos
(playerid, up
[0], up
[1], up
[2]);
carid
= CreateVehicle
(411, up
[0]+2, up
[1]+2, up
[2],
0,
-1,
-1,
0);
PutPlayerInVehicle
(playerid, carid,
0);
return 1;
}//DIALOGS=======================================================================public OnDialogResponse
(playerid, dialogid, response, listitem, inputtext
[]){ if(dialogid
== 0) { if(response
) { if(!inputtext
[0]) return ShowPlayerDialog
(playerid,
0, DIALOG_STYLE_PASSWORD,
""COL_BLUE
"TVSP"COL_WHITE
" Login pannel",
""chat
" Please login to play on "COL_BLUE
"Terminators VS Predators\n "COL_WHITE
"Enter your "COL_BLUE
"password"COL_WHITE
":",
"Login",
"Exit");
new buf
[129];
WP_Hash
(buf,
129, inputtext
);
if(!strcmp(buf, User
[playerid
][USER_PASSWORD
], false
)) { new Query
[75],
DBResult: Result;
format(Query,
sizeof(Query
),
"SELECT * FROM users WHERE username = '%s' LIMIT 0, 1", DB_Escape
(User
[playerid
][USER_NAME
]));
Result
= db_query
(Database, Query
);
if(db_num_rows
(Result
)) { db_get_field_assoc
(Result,
"userid", Query,
7);
User
[playerid
][USER_ID
] = strval(Query
);
db_get_field_assoc
(Result,
"admin", Query,
3);
User
[playerid
][USER_ADMIN
] = strval(Query
);
db_get_field_assoc
(Result,
"vip", Query,
3);
User
[playerid
][USER_VIP
] = strval(Query
);
db_get_field_assoc
(Result,
"money", Query,
10);
User
[playerid
][USER_MONEY
] = strval(Query
);
db_get_field_assoc
(Result,
"score", Query,
7);
User
[playerid
][USER_SCORE
] = strval(Query
);
db_get_field_assoc
(Result,
"kills", Query,
10);
User
[playerid
][USER_KILLS
] = strval(Query
);
db_get_field_assoc
(Result,
"deaths", Query,
10);
User
[playerid
][USER_DEATHS
] = strval(Query
);
User
[playerid
][USER_LOGGED_IN
] = true;
GivePlayerMoney
(playerid, User
[playerid
][USER_MONEY
]);
SetPlayerScore
(playerid, User
[playerid
][USER_SCORE
]);
SendClientMessage
(playerid, 0x00FF00FF,
""chat
" "COL_LIGHTBLUE
"You have successfully logged in to your account!");
} db_free_result
(Result
);
} else { SendClientMessage
(playerid,
-1,
""chat
" "COL_RED
"Incorrect password!");
ShowPlayerDialog
(playerid,
0, DIALOG_STYLE_PASSWORD,
""COL_BLUE
"TVSP"COL_WHITE
" Login pannel",
""chat
" Please login to play on "COL_BLUE
"Terminators VS Predators\n"COL_WHITE
"Enter your "COL_BLUE
"password"COL_WHITE
":",
"Login",
"Exit");
} } else Kick
(playerid
);
return 1;
} if(dialogid
== 1) { if(response
) { if(!IsValidPassword
(inputtext
)) { SendClientMessage
(playerid,
-1,
""chat
" "COL_RED
"The password is invalid, Valid characters are: A-Z, a-z, 0-9");
ShowPlayerDialog
(playerid,
1, DIALOG_STYLE_PASSWORD,
""COL_BLUE
"SERVER NAME"COL_WHITE
" Register pannel",
""chat
" Please register to play on "COL_BLUE
"SERVER NAME\n"COL_WHITE
"Enter a "COL_BLUE
"password"COL_WHITE
":",
"Register",
"Exit");
return 1;
} if(strlen(inputtext
) < 3 ||
strlen(inputtext
) > 24) { SendClientMessage
(playerid,
-1,
""chat
" "COL_RED
"The password is invalid, Its lenght should be 3-24 characters");
ShowPlayerDialog
(playerid,
1, DIALOG_STYLE_PASSWORD,
""COL_BLUE
"SERVER NAME"COL_WHITE
" Register pannel",
""chat
" Please register to play on "COL_BLUE
"SERVER NAME\n"COL_WHITE
"Enter a "COL_BLUE
"password"COL_WHITE
":",
"Register",
"Exit");
return 1;
} new Query
[208];
WP_Hash
(User
[playerid
][USER_PASSWORD
],
129, inputtext
);
format(Query,
sizeof(Query
),
"INSERT INTO users (username, password) VALUES ('%s', '%s')", DB_Escape
(User
[playerid
][USER_NAME
]), DB_Escape
(User
[playerid
][USER_PASSWORD
]));
db_query
(Database, Query
);
User
[playerid
][USER_LOGGED_IN
] = true;
SendClientMessage
(playerid, 0x00FF00FF,
""chat
" "COL_LIGHTBLUE
"You have just registered to our server! You have been automatically logged in!");
} else Kick
(playerid
);
return 1;
} return 1;
}//STOCKS========================================================================//DB ESCAPEstock DB_Escape
(text
[]){ new ret
[ 80 * 2 ], ch, i, j;
while((ch
= text
[i
++]) && j
< sizeof(ret
)) { if(ch
== '\'') { if(j
< sizeof(ret
) - 2) { ret
[j
++] = '\'';
ret
[j
++] = '\'';
} } else if(j
< sizeof(ret
)) { ret
[j
++] = ch;
} else { j
++;
} } ret
[sizeof(ret
) - 1] = '\0';
return ret;
}//VALID PASSWORDstock IsValidPassword
(const password
[]){ for(new i
= 0; password
[i
] != EOS;
++i
) { switch(password
[i
]) { case '0'..
'9',
'A'..
'Z',
'a'..
'z': continue;
default: return 0;
} } return 1;
}//PLAYER NAMEstock PlayerName
(playerid
){ new ppName
[24];
GetPlayerName
(playerid, ppName,
24);
return ppName;
}