26.06.2011, 23:33
PHP код:
new canselafechada;
new canselaaberta;
forward tempocansela(playerid);
public OnGameModeInit()
{
canselafechada = CreateDynamicObject(968,1216.78515625,306.50247192,19.94689178,0.00000000,90.00000000,245.25000000);
return 1;
}
public OnGameModeExit()
{
DestroyDynamicObject(canselafechada);
DestroyDynamicObject(canselaaberta);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/comprarbilhete", true)) // By Ellis
{
if (IsPlayerInRangeOfPoint(playerid, 15.0, 1212.7277, 303.9298, 19.5469))
{
DestroyDynamicObject( canselafechada );
canselaaberta = CreateDynamicObject(968,1216.55664062,305.94561768,19.94689178,0.00000000,9.00000000,245.24780273);
GivePlayerMoney(playerid, -500);
SetTimer("tempocansela", 6000, 0);
SendClientMessage(playerid, COLOR_GREEN,"{FFFFFF}Entras-te no parque de estacionamento do {008000}LaMovida {FFFFFF}e pagas-te {BF0000}500Ђ{FFFFFF}.");
}
return 1;
}
if(!strcmp(cmdtext, "/usarbilhete", true)) // By Ellis
{
if (IsPlayerInRangeOfPoint(playerid, 15.0, 1218.0685, 301.7553, 19.6039))
{
DestroyDynamicObject( canselafechada );
canselaaberta = CreateDynamicObject(968,1216.55664062,305.94561768,19.94689178,0.00000000,9.00000000,245.24780273);
SetTimer("tempocansela", 6000, 0);
SendClientMessage(playerid, COLOR_GREEN,"{FFFFFF}Saiste do parque de estacionamento do {008000}LaMovida{FFFFFF}.");
}
return 1;
}
return 0;
}
public tempocansela()
{
DestroyObject( canselaaberta );
canselafechada = CreateDynamicObject(968,1216.78515625,306.50247192,19.94689178,0.00000000,90.00000000,245.25000000);
return 1;
}