tak vam tu zrobim bar ok hore:
takze do OnPlayerCommandText
no a dole do modu:
/vykurit:
/cigy - to je na info kolko ma cigariet
to je vsetko samozrejme su viac specialne akcie ako tanec:
- kód:
new cigy[MAX_PLAYERS];
new pick;
- kód:
pick = CreatePickup(idpickupu,1,x,y,z,vw);
- kód:
if(pickupid == rpick){
ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Rbar","cigu\nsprite\npivo$\nvino","kúpit","nič");
}
- kód:
if(dialogid == 3)
{
if(response == 1)
{
if(listitem == 0)//ak vyberie 1 polosku
{
cigy[playerid] += 1;
}
if(listitem == 1)//ak vyberie 2 polosku
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
SendClientMessage(playerid,COLOR_FIALOVA,"kKúpil si si sprite");
}
if(listitem == 2)//ak vyberie 3 polosku
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
SendClientMessage(playerid,COLOR_FIALOVA,"Kúpil si si pivo");
}
if(listitem == 3)//ak vyberie 4 polosku
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
SendClientMessage(playerid,COLOR_FIALOVA,"Kúpil si si víno");
}
}
}
takze do OnPlayerCommandText
- kód:
dcmd(vykurit,7,cmdtext);
dcmd(cigy,4,cmdtext);
no a dole do modu:
/vykurit:
- kód:
dcmd_vykurit(playerid, params[])
{
#pragma unused params
if(cigy[playerid] == 0) return SendClientMessage(playerid,0xFF0000AA,"Nemáš cigaretu");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
SendClientMessage(playerid,0xFF0000AA,"dymi sa s teba jak s lokomotivy :D");
cigy[playerid] -= 1;
return 1;
}
/cigy - to je na info kolko ma cigariet
- kód:
dcmd_cigy(playerid,params[])
{
new string[256];
format(string,sizeof(string), "=mas %d cigariet =",cigy[playerid]);
SendClientMessageToAll(COLOR_FIALOVA,string);
return 1;
}
to je vsetko samozrejme su viac specialne akcie ako tanec:
- kód:
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);