Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //no topo:
- new Menu:m_animal;
- enum e_animal
- {
- golfinho,
- tubarao,
- tartaruga
- }
- new animal[MAX_PLAYERS][e_animal];
- //no OnGameModeInit ou OnFilterScriptInit:
- m_animal = CreateMenu("Tranforma��o", 1, 50, 200, 90, 25);
- AddMenuItem(m_animal, 0, "Golfinho");
- AddMenuItem(m_animal, 0, "Tubar�o");
- AddMenuItem(m_animal, 0, "Tartaruga");
- AddMenuItem(m_animal, 0, "Humano");
- //no OnPlayerCommandText:
- if(!strcmp(cmdtext, "/transforma��o", true))
- {
- ShowMenuForPlayer(m_animal, playerid);
- return 1;
- }
- //no OnPlayerSelectedMenuRow:
- if(GetPlayerMenu(playerid) == m_animal)
- {
- switch(row)
- {
- case 0:
- {
- if(animal[playerid][golfinho] < 1)
- {
- animal[playerid][golfinho] = CreateObject(1607, 0.0, 0.0, 0.0, 0, 0, 0);
- AttachObjectToPlayer(animal[playerid][golfinho], playerid, 0.0, 0.0, 2.0, 0, 0, 0);
- }
- }
- case 1:
- {
- if(animal[playerid][tubarao] < 1)
- {
- animal[playerid][tubarao] = CreateObject(1608, 0.0, 0.0, 0.0, 0, 0, 0);
- AttachObjectToPlayer(animal[playerid][tubarao], playerid, 0.0, 0.0, 2.0, 0, 0, 0);
- }
- }
- case 2:
- {
- if(animal[playerid][tartaruga] < 1)
- {
- animal[playerid][tartaruga] = CreateObject(1609, 0.0, 0.0, 0.0, 0, 0, 0);
- AttachObjectToPlayer(animal[playerid][tartaruga], playerid, 0.0, 0.0, 2.0, 0, 0, 0);
- }
- }
- case 3:
- {
- if(animal[playerid][golfinho] > 0)DestroyObject(animal[playerid][golfinho]);
- if(animal[playerid][tubarao] > 1)DestroyObject(animal[playerid][tubarao]);
- if(animal[playerid][tartaruga] > 1)DestroyObject(animal[playerid][tartaruga]);
- }
- }
- }
Add Comment
Please, Sign In to add comment