F:\SAMP\samp037_svr_R2-1-1_win32\gamemodes\bare.pwn(149) : error 010: invalid function or declaration
F:\SAMP\samp037_svr_R2-1-1_win32\gamemodes\bare.pwn(151) : error 010: invalid function or declaration
F:\SAMP\samp037_svr_R2-1-1_win32\gamemodes\bare.pwn(156) : error 010: invalid function or declaration
F:\SAMP\samp037_svr_R2-1-1_win32\gamemodes\bare.pwn(158) : error 010: invalid function or declaration
F:\SAMP\samp037_svr_R2-1-1_win32\gamemodes\bare.pwn(165) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
public OnPlayerUpdate(playerid)
{
if(twotime[playerid]!=0)
{
if(gettime()-twotime[playerid]>=10000)
{
twotime[playerid]=0;
SetPlayerPos(playerid,-318.3269, 1519.2313, 75.2519);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,150,1205.0674, -8.3971, 1000.6484)==0)
{
SetPlayerPos(playerid,1205.0674, -8.3971, 1000.6484);
SetPlayerInterior(playerid,2);
}
}
}
return 1;
}
#include <a_samp>
#include <core>
#include <float>
//皮卡
new pickupone;
new pickuptwo;
new pickupthree;
new pickupfour;
//玩家变量
new onetime[MAX_PLAYERS];
new twotime[MAX_PLAYERS];
#pragma tabsize 0
main()
{
print("\n----------------------------------");
print(" Bare Script\n");
print("----------------------------------\n");
}
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
onetime[playerid]=0;
twotime[playerid]=0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/yadayada", true) == 0) {
return 1;
}
return 0;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnGameModeInit()
{
SetGameModeText("Bare Script");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1);
pickupone = CreatePickup(1318,23,-314.8353, 1514.9579, 75.2519);//进入KTV
pickuptwo = CreatePickup(1318,23,-2636.7197, 1402.8058, 906.2675);//离开KTV
pickupthree = CreatePickup(1318,23,-318.0620, 1513.9407, 75.2519);//进入KTV2
pickupfour = CreatePickup(1318,23,1205.0782, -12.0614, 1000.6484);//离开KTV2
Create3DTextLabel("进入KTV", 0x008080FF, -314.8353, 1514.9579, 75.2519, 15, 0, 0);
Create3DTextLabel("离开KTV", 0x008080FF, -2636.7197, 1402.8058, 906.2675, 15, 0, 0);
Create3DTextLabel("进入KTV2", 0x008080FF, -318.0620, 1513.9407, 75.2519, 15, 0, 0);
Create3DTextLabel("离开KTV2", 0x008080FF, 1205.0782, -12.0614, 1000.6484, 15, 0, 0);
return 1;
}
public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == pickupone)
{
onetime[playerid]=gettime();
SetPlayerPos(playerid,-2636.6272, 1406.4064, 906.2675);
SetPlayerInterior(playerid,3);
GameTextForPlayer(playerid,"~r~Welcome to the ktv",4000,2);
}
if(pickupid == pickuptwo)
{
if(onetime[playerid]!=0)
{
onetime[playerid]=0;
SetPlayerPos(playerid,-315.1715, 1519.6599, 75.2519);
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid,"~r~Welcome back",4000,2);
}
}
if(pickupid == pickupthree)
{
twotime[playerid]=gettime();
SetPlayerPos(playerid,1205.0674, -8.3971, 1000.6484);
SetPlayerInterior(playerid,2);
GameTextForPlayer(playerid,"~r~Welcome to the ktv two",4000,2);
}
if(pickupid == pickupfour)
{
if(twotime[playerid]!=0)
{
twotime[playerid]=0;
SetPlayerPos(playerid,-318.3269, 1519.2313, 75.2519);
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid,"~r~Welcome back",4000,2);
}
}
}
public OnPlayerUpdate(playerid)
{
if(onetime[playerid]!=0)
{
if(gettime()-onetime[playerid]>=10000)
{
onetime[playerid]=0;
SetPlayerPos(playerid,-315.1715, 1519.6599, 75.2519);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,150,-2636.6272, 1406.4064, 906.2675)==0)
{
SetPlayerPos(playerid,-2636.6272, 1406.4064, 906.2675);
SetPlayerInterior(playerid,3);
}
}
}
return 1;
}
if(twotime[playerid]!=0)
{
if(gettime()-twotime[playerid]>=10000)
{
twotime[playerid]=0;
SetPlayerPos(playerid,-318.3269, 1519.2313, 75.2519);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,150,1205.0674, -8.3971, 1000.6484)==0)
{
SetPlayerPos(playerid,1205.0674, -8.3971, 1000.6484);
SetPlayerInterior(playerid,2);
}
}
}
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerUpdate(playerid)
{
if(onetime[playerid]!=0)
{
if(gettime()-onetime[playerid]>=10000)
{
onetime[playerid]=0;
SetPlayerPos(playerid,-315.1715, 1519.6599, 75.2519);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,150,-2636.6272, 1406.4064, 906.2675)==0)
{
SetPlayerPos(playerid,-2636.6272, 1406.4064, 906.2675);
SetPlayerInterior(playerid,3);
}
}
}
return 1;
} //<------ Error lies here.
if(twotime[playerid]!=0) //<--- This code, is in the wrong spot, and everything below it, is also having trouble due to it. That is, up until strtok is made.
{
Right, so where you have OnPlayerUpdate, you've got a return, finish that callabck, then seem to have added a heap more in nothingness.
PHP код:
![]() See, you're learning already... xD |
public OnPlayerUpdate(playerid)
{
if(onetime[playerid]!=0)
{
if(gettime()-onetime[playerid]>=10000)
{
onetime[playerid]=0;
SetPlayerPos(playerid,-315.1715, 1519.6599, 75.2519);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,150,-2636.6272, 1406.4064, 906.2675)==0)
{
SetPlayerPos(playerid,-2636.6272, 1406.4064, 906.2675);
SetPlayerInterior(playerid,3);
}
}
} //<--- Notice the return and the remaining } are gone.
if(twotime[playerid]!=0)
{
if(gettime()-twotime[playerid]>=10000)
{
twotime[playerid]=0;
SetPlayerPos(playerid,-318.3269, 1519.2313, 75.2519);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,150,1205.0674, -8.3971, 1000.6484)==0)
{
SetPlayerPos(playerid,1205.0674, -8.3971, 1000.6484);
SetPlayerInterior(playerid,2);
}
}
}
return 1;
}