Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2014-10-21, 18:08


awfesa







Wiek: 29
Na forum: 4705 dni
Posty: 563

Piwa: 223

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

Mam taki kod i jak zrobi? aby komend? tylko dzia?a w 4 wyznaczonych pojazdach a nie w wyznaczonych id pojazd?w

Pojazdy

Pawn
    
pizza[0] = AddStaticVehicle(448,2122.1677,-1784.2250,12.9837,180.4585,0,0); // Pizza 1
    pizza[1] = AddStaticVehicle(448,2121.9895,-1784.7623,12.9867,181.5936,0,0); // Pizza 1
    pizza[2] = AddStaticVehicle(448,2118.8469,-1784.5692,12.9880,181.5090,0,0); // Pizza 2
    pizza[3] = AddStaticVehicle(448,2115.7837,-1784.6464,12.9860,181.6605,0,0); // Pizza 3


CMD

Pawn
public OnPlayerCommandText(playeridcmdtext[])
{
    if (strcmp("/pizza"cmdtexttrue10) == 0)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
        {
            PizzaJob[playerid] = 1;
            new name[MAX_PLAYER_NAME], string[48];
            GetPlayerName(playeridnamesizeof(name));
            format(stringsizeof(string), "* %s is now a Pizzaboy."name );
            SendClientMessageToAll(COLOR_YELLOWstring);
            SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
            SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
            return 1;
        }
        SendClientMessage(playeridCOLOR_RED,"You have to be on a pizza bike to start the job!");
    }
    return 0;
}


Podpis

Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-21, 18:13


xqz

otaku desu!






Wiek: 32
Na forum: 6407 dni
Posty: 723
Nick w MP: xqz

Piwa: 5465

Respekt: 418,6
Respekt: 418,6

Kod:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pizza", cmdtext, true, 10) == 0)
{
new omg=GetPlayerVehicleID(playerid);
if(omg == pizza[0] || omg == pizza[1] || omg == pizza[2] || omg == pizza[3] )
{
PizzaJob[playerid] = 1;
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s is now a Pizzaboy.", name );
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
return 1;
}
SendClientMessage(playerid, COLOR_RED,"You have to be on a pizza bike to start the job!");
}
return 0;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-21, 20:25


awfesa







Wiek: 29
Na forum: 4705 dni
Posty: 563

Piwa: 223

Respekt: 280
Respekt: 280Respekt: 280Respekt: 280

Dzia?a wielkie dzi?ki

:piwo: dla ciebie ;)

Podpis

Cokolwiek robicie w swoim życiu, nie będzie to legendarne,
jeżeli wasi przyjaciele nie będą mogli tego zobaczyć.
Postaw piwo autorowi tego posta
 

 
Tagi: cmd :: tylko :: pojazdach
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku