26.03.2012, 09:48
(
Последний раз редактировалось jaami; 26.03.2012 в 11:16.
)
Ok this system is abit buggy dont know why.
http://s1144.photobucket.com/albums/...=sa-mp-028.png
http://s1144.photobucket.com/albums/...=sa-mp-029.png
After typing the password it should save in player data base.
http://s1144.photobucket.com/albums/...=sa-mp-030.png
There is says it is save but.
But when i press spawn nothing happen, but when i press arrow it says this
http://s1144.photobucket.com/albums/...=sa-mp-031.png
This is the registration code
Please kindly help me and spot my mistake for me.
http://s1144.photobucket.com/albums/...=sa-mp-028.png
http://s1144.photobucket.com/albums/...=sa-mp-029.png
After typing the password it should save in player data base.
http://s1144.photobucket.com/albums/...=sa-mp-030.png
There is says it is save but.
But when i press spawn nothing happen, but when i press arrow it says this
http://s1144.photobucket.com/albums/...=sa-mp-031.png
This is the registration code
PHP код:
public OnPlayerRequestClass(playerid)
{
SetPlayerCameraPos(playerid, -2604.2324,490.6546,68.6727);
SetPlayerCameraLookAt(playerid, -2381.7639,793.5422,101.3817);
SetPlayerPos(playerid, -2381.7639,793.5422,101.3817);
ClearChat(playerid);
if(Account[playerid] == 1)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account.","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel.","Login","Cancel");
}
else
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register your account.","Note - A account with this name was not found inside the database.\n if you would like to register this account,\n type in the password you would like to tegister with.","Register","Cancel");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Password Cannot be Blank"); Kick(playerid);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register your account","Note - A Account with this name was not found inside the database\n if you would like to register this account\nType in the password you would like to register with.","Register","Cancel");
return 1;
}
if(!response){ SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!"); Kick(playerid); return 0; }
//Encrypt(inputtext);
OnPlayerRegister(playerid, inputtext);
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
InfoBoxForPlayer(playerid, "You registered now fill out the information about your character. Have fun.");
}
if(dialogid == 2)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Password Cannot be left Blank"); Kick(playerid);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel!","Login","Cancel");
return 1;
}
if(!response){ SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!"); Kick(playerid); return 0; }
//Encrypt(inputtext);
OnPlayerLogin(playerid,inputtext);
}
if(dialogid == 3)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Age Cannot be Blank");
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Age","How old are you?","Continue","Cancel");
return 1;
}
if(!response){ Kick(playerid); PlayerInfo[playerid][pTut] = 1; return 1; }
//PlayerInfo[playerid][pTut] = 2;
if (strval(inputtext) == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Invalid Age.");
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Age","How old are you?","Continue","Cancel");
return 1;
}
OnAgeGiven(playerid, inputtext);
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
}
if(dialogid == 4)
{
if(!response){ ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Religon","Jewish\nMuslim\nChristian\nCatholic\nIslam\nHindu\nBuddist\nAtheist","Continue","Cancel"); return 1; }
if(listitem == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Jewish");
OnReligonGiven(playerid, "Jewish");
}
if(listitem == 1)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Muslim");
OnReligonGiven(playerid, "Muslim");
}
if(listitem == 2)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Christian");
OnReligonGiven(playerid, "Christian");
}
if(listitem == 3)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Catholic");
OnReligonGiven(playerid, "Catholic");
}
if(listitem == 4)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Islam");
OnReligonGiven(playerid, "Islam");
}
if(listitem == 5)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Hindu");
OnReligonGiven(playerid, "Hindu");
}
if(listitem == 6)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Buddist");
OnReligonGiven(playerid, "Buddist");
}
if(listitem == 7)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Character is Atheist");
OnReligonGiven(playerid, "Atheist");
}
//PlayerInfo[playerid][pTut] = 3;
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
}
if(dialogid == 5)
{
//new string[128];
if(!response){ ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Where did you come from?","Los Santos\nSan Fierro\nLas Venturas","Continue","Cancel"); return 1; }
if(listitem == 0)
{
PlayerInfo[playerid][pReg] = 20;
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel!","Login","Cancel");
}
if(listitem == 1)
{
PlayerInfo[playerid][pReg] = 20;
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel!","Login","Cancel");
}
if(listitem == 2)
{
PlayerInfo[playerid][pReg] = 20;
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel!","Login","Cancel");
}
if(listitem == 4)
{
PlayerInfo[playerid][pReg] = 20;
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel!","Login","Cancel");
}
if(listitem == 5)
{
PlayerInfo[playerid][pReg] = 20;
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login to your account","Note - A account with this name was found inside the database,\n If this is your account,type in your password\n if not press cancel!","Login","Cancel");
}
PlayerInfo[playerid][pTut] = 999;
PlayerInfo[playerid][pReg] = 20;
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
return 1;
}
if(dialogid == 6)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your left your advertisement blank.");
return 1;
}
if(response)
{
new string2[128];
format(string2, sizeof(string2), "Ad: %s (%s)", inputtext, GetPlayerNameEx(playerid));
SendClientMessageToAll(0x4B00B0AA, string2);
GivePlayerCash(playerid, -AdPrice);
format(string2, sizeof(string2), "That Advertisement costed you $%d.", AdPrice);
SendClientMessage(playerid, 0x4B00B0AA, string2);
}
}
if(dialogid == 7) // Weed, Cocaine, Mushrooms. and LSD
{
if(!response){ return 1; }
if(listitem == 0)
{
if(GetPlayerCash(playerid) >= 700)
{
GivePlayerCash(playerid, -700);
PlayerInfo[playerid][pWeedSeeds] += 5;
SendClientMessage(playerid, 0x4B00B0AA, "Info - You bought 5 Marajuana Seeds from the drug dealer!");
}
else
{
SendClientMessage(playerid, 0x4B00B0AA, "You need some money! [700]");
}
}
if(listitem == 1)
{
if(GetPlayerCash(playerid) >= 700)
{
GivePlayerCash(playerid, -700);
PlayerInfo[playerid][pCokeSeeds] += 5;
SendClientMessage(playerid, 0x4B00B0AA, "Info - You bought 5 Cok. Seeds from the drug dealer!");
}
else
{
SendClientMessage(playerid, 0x4B00B0AA, "You need some money! [700]");
}
}
if(listitem == 2)
{
if(GetPlayerCash(playerid) >= 700)
{
GivePlayerCash(playerid, -700);
PlayerInfo[playerid][pShroomSeeds] += 5;
SendClientMessage(playerid, 0x4B00B0AA, "Info - You bought 5 Mushroom Seeds from the drug dealer!");
}
else
{
SendClientMessage(playerid, 0x4B00B0AA, "You need some money! [700]");
}
}
if(listitem == 3)
{
if(GetPlayerCash(playerid) >= 1000)
{
GivePlayerCash(playerid, -1000);
PlayerInfo[playerid][pLSD] += 3;
SendClientMessage(playerid, 0x4B00B0AA, "Info - You bought 3 LSDs from the drug dealer!");
}
else
{
SendClientMessage(playerid, 0x4B00B0AA, "You need some money! [1000]");
}
}
}
if(dialogid == 8)
{
if(!response){ RemoveDriverFromVehicle(playerid); return 1; }
if(engineWait[playerid] == 1)
{
GameTextForPlayer(playerid, "Please Wait...", 3000, 1);
ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Hotwire Vehicle","You don't have the keys to this vehicle, But this can be hotwired!","Hotwire","Cancel");
return 1;
}
if(engine[GetPlayerVehicleID(playerid)-1] == 0)
{
new string[128];
new rand = random(3);
switch(rand)
{
case 0:
{
format(string, sizeof(string), "%s attempts to hotwire the vehicle, and the vehicle's engine doesnt turn on!", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
SetTimerEx("engineW", 5000, 0, "d", playerid);
engineWait[playerid] = 1;
ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Hotwire Vehicle","You don't have the keys to this vehicle, But this can be hotwired!","Hotwire","Cancel");
return 1;
}
case 1:
{
format(string, sizeof(string), "%s attempts to hotwire the vehicle, and the vehicle's engine doesnt turn on!", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
SetTimerEx("engineW", 5000, 0, "d", playerid);
engineWait[playerid] = 1;
ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Hotwire Vehicle","You don't have the keys to this vehicle, But this can be hotwired!","Hotwire","Cancel");
return 1;
}
case 2:
{
format(string, sizeof(string), "%s attempts to hotwire the vehicle, and the vehicle's engine turns on!", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
engine[GetPlayerVehicleID(playerid)-1] = 1;
TogglePlayerControllable(playerid, true);
return 1;
}
case 3:
{
format(string, sizeof(string), "%s attempts to hotwire the vehicle, and the vehicle's engine turns on!", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
engine[GetPlayerVehicleID(playerid)-1] = 1;
TogglePlayerControllable(playerid, true);
return 1;
}
}
}
}
if(dialogid == 9)
{
if(!response) SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
new message[196];
format(message, sizeof(message), "Firefox - Loading %s........", inputtext);
SendClientMessage(playerid, 0xFFFFFFFF, message);
new randMSG = random(sizeof(RandomMSG));
SendClientMessage(playerid, 0xFFFFFFFF, RandomMSG[randMSG]);
new Rand = random(1);
switch(Rand)
{
case 0:
{
PlayerInfo[playerid][pVirus] = 1;
}
case 1:
{
}
}
return 1;
}