04.04.2012, 00:38
Yo, i just tryed to add a Spawn Vehicle dialog
At the start i registed and got my money for registrering, then i spawned a car, but when i spawned the car i got the register cash again
Then i tryed to relog and see if it was only when i registed, but when i tryed to login it said WRONG PASSWORD
I know i have done something wrong between Register and Vehicle dialog, tell me how i can fix it please
I know i need something between them but i dunno what
At the start i registed and got my money for registrering, then i spawned a car, but when i spawned the car i got the register cash again
Then i tryed to relog and see if it was only when i registed, but when i tryed to login it said WRONG PASSWORD
I know i have done something wrong between Register and Vehicle dialog, tell me how i can fix it please
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit"); GivePlayerMoney(playerid, 100000); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Password",udb_hash(inputtext)); INI_WriteInt(File,"Cash",0); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_Close(File); } } case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit"); } return 1; } } } new Float:x,Float:y,Float:z; if(dialogid==1 && response==1) { switch(listitem) { case 0: { GetPlayerPos(playerid,x,y,z); CreateVehicle(432,x-3.0,y,z,0.0,1,1,300); } case 1: { GetPlayerPos(playerid,x,y,z); CreateVehicle(407,x-3.0,y,z,0.0,1,3,300); } case 2: { GetPlayerPos(playerid,x,y,z); CreateVehicle(411,x-3.0,y,z,0.0,1,0,300); } case 3: { GetPlayerPos(playerid,x,y,z); CreateVehicle(451,x-3.0,y,z,0.0,0,1,300); } case 4: { GetPlayerPos(playerid,x,y,z); CreateVehicle(406,x-3.0,y,z,0.0,1,1,300); } } } return 1; }