new Float:VanUnloads[][14] = {
{2474.0447,1124.0911,10.8203},
{2511.2468,1665.0664,10.8203},
{2042.2836,2141.9180,10.8203},
{2055.6897,2199.2947,10.8203},
{1981.7634,2077.4819,10.8203},
{1373.0298,1968.3542,11.2573},
{1342.2938,1988.8014,10.8127},
{1307.9276,2084.5015,10.8203},
{1297.5133,2082.0200,10.8127},
{1145.5381,2036.6021,10.8203},
{948.7875,2073.2620,10.8203},
{766.6767,2057.3159,6.7109},
{587.8662,1642.3119,6.9922},
{541.5541,1557.5353,1.0000}
};
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
if(IsPlayerInVehicle(playerid, 5))
{
new rand = random(sizeof(VanUnloads));
SetPlayerRaceCheckpoint(playerid, 0,VanUnloads[rand][0], VanUnloads[rand][1],VanUnloads[rand][2],0,0,0,10);
printf("Played %s has started a van mission",GetName(playerid));
}
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == 5 || vehicleid == 7 || vehicleid == 8 ||vehicleid == 4 || vehicleid == 6)
{
GameTextForPlayer(playerid, "To start drug missions press ~g~MMB",5000,5);
}
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
new string[100];
new earnamount = random(5000-2000)+2000;
GivePlayerMoney(playerid, earnamount);
format(string,sizeof(string),"You have earnt $%d for delievering the drugs. press MMB to start another mission.",earnamount);
SendClientMessage(playerid, COLOR_YELLOW,string);
DisablePlayerRaceCheckpoint(playerid);
drugmissions[playerid]++;
return 1;
}
if(newkeys & KEY_SUBMISSION)
pawn Код:
You could leave both them without specifying a size and the compiler will calculate the size at compile time. Then you can add more co-ords w/o worrying about size. |
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)
{
if(IsPlayerInVehicle(playerid, 5))
{
new rand = random(sizeof(VanUnloads));
SetPlayerRaceCheckpoint(playerid, 0,VanUnloads[rand][0], VanUnloads[rand][1],VanUnloads[rand][2],0,0,0,10);
printf("Played %s has started a van mission",GetName(playerid));
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)
{
if(IsPlayerInAnyVehicle(playerid))
{
printf("Played %s has started a van mission");
}
}
return 1;
}
Yeh i'v done something wrong, that doesn't print in the console.
|
Originally Posted by iggys log
[14:07:44] Played has started a van mission
[14:07:45] Played has started a van mission [14:07:45] Played has started a van mission [14:07:45] Played has started a van mission [14:07:45] Played has started a van mission [14:07:46] Played has started a van mission [14:07:46] Played has started a van mission [14:07:47] Played has started a van mission [14:07:47] Played has started a van mission [14:07:48] Played has started a van mission |
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)
{
if(IsPlayerInAnyVehicle(playerid))
{
printf("Played %s has started a van mission"); //didn't print
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)
{
printf("Played %s has started a van mission"); // did print.
}
return 1;
}