Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new
- gLvl [ MAX_PLAYERS ] ,
- gXp [ MAX_PLAYERS ] ,
- gXpNext ,
- gXpGained;
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if ( killerid == INVALID_PLAYER_ID )
- {
- gXp [ playerid ] -= gXpGained ;
- gXp [ killerid ] += gXpGained ;
- if ( gXp [ killerid ] == gXpNext )
- {
- gXp [ killerid ] = 0 ;
- gLvl [ killerid ] ++ ;
- }
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (!strcmp(cmdtext,"/setxp")) ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Escolha de xp", "Digite o xp recebido por morte.", "Confirmar", "");
- if (!strcmp(cmdtext,"/setlvl"))ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Escolha de xp", "Digite o xp necessário para subir de nível.", "Confirmar", "");
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case 1:
- {
- if (inputtext[0] == '\0') return false;
- gXpGained = strval(inputtext);
- }
- case 2:
- {
- if (inputtext[0] == '\0') return false;
- gXpNext = strval(inputtext);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment