SA-MP Forums Archive
String error /variables help :( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: String error /variables help :( (/showthread.php?tid=281493)



String error /variables help :( - stylerof619 - 06.09.2011

need help with this


pawn Код:
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(12) : error 001: expected token: ";", but found "new"
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(87) : error 001: expected token: ",", but found "."
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(87) : error 029: invalid expression, assumed zero
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(87) : warning 215: expression has no effect
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(87) : error 001: expected token: ";", but found "sizeof"
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(87) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
pawn Код:
//variabele
new variabele = 1
new variabeleempty;


#if defined FILTERSCRIPT


public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" TEST SERVER");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" TWISTEDґs TEST SERVER");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{

SetGameModeText("TEST");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 1, 0, 0, 0, 0, 0);
//cars
AddStaticVehicle(509,1229.8336,-925.2338,42.2838,162.9694,61,1); //bike at BSN
AddStaticVehicle(509,1227.9171,-925.3457,42.7996,191.3384,61,1); //bike 2 bsn
AddStaticVehicle(509,1226.1729,-925.6810,42.8143,191.338,61,1); //bike 3 bsn
AddStaticVehicle(509,1224.9955,-926.3659,42.8090,191.3384,61,1); //bike 4 bsn
AddStaticVehicle(509,1231.2554,-924.6794,42.7721,191.3384,61,1); //bike 5 bsn
AddStaticVehicle(509,1233.1501,-924.6672,42.7443,191.338,61,1); //bike 6 bsn
AddStaticVehicle(509,1235.0730,-924.7230,42.7205,191.3384,61,1); //bike 7 bsn

//3D TEXT
Create3DTextLabel("this is the Spawn:\0.1",0xFFB400FF,1265.8516,-885.3967,42.8828+1.0,40.0,0);

printf("%d",variabele);


return 1;
}



public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerVirtualWorld(playerid,1+playerid);
SetPlayerPos(playerid,1202.3580,-902.9371,48.0625);
SetPlayerCameraPos(playerid,1202.3580,-902.9371,48.0625);
SetPlayerCameraLookAt(playerid,1202.3580,-902.9371,48.0625);
return 1;
}

public OnPlayerConnect(playerid)
{
    new string[100];
    variabeleempty = 100;
    SendClientMessage(playerid,RED,"When i See Dm with the  Brass knuckles at the spawn youґll get Banned");
    SendClientMessage(playerid,ORANGE,"Hello this is a testserver");
    format(string.sizeof(string),"here comes the number %d".,variabeleempty);
    SendClientMessage(playerid,RED,string);
    return 1;
}
really need help with it


Re: String error /variables help :( - =WoR=G4M3Ov3r - 06.09.2011

PHP код:
//variabele
new variabele 1;
new 
variabeleempty;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(
"\n--------------------------------------");
print(
" TEST SERVER");
print(
"--------------------------------------\n");
return 
1;
}
public 
OnFilterScriptExit()
{
return 
1;
}
#else
main()
{
print(
"\n----------------------------------");
print(
" TWISTEDґs TEST SERVER");
print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
SetGameModeText("TEST");
AddPlayerClass(01958.37831343.157215.3746269.1425100000);
//cars
AddStaticVehicle(509,1229.8336,-925.2338,42.2838,162.9694,61,1); //bike at BSN
AddStaticVehicle(509,1227.9171,-925.3457,42.7996,191.3384,61,1); //bike 2 bsn
AddStaticVehicle(509,1226.1729,-925.6810,42.8143,191.338,61,1); //bike 3 bsn
AddStaticVehicle(509,1224.9955,-926.3659,42.8090,191.3384,61,1); //bike 4 bsn
AddStaticVehicle(509,1231.2554,-924.6794,42.7721,191.3384,61,1); //bike 5 bsn
AddStaticVehicle(509,1233.1501,-924.6672,42.7443,191.338,61,1); //bike 6 bsn
AddStaticVehicle(509,1235.0730,-924.7230,42.7205,191.3384,61,1); //bike 7 bsn
//3D TEXT
Create3DTextLabel("this is the Spawn:\0.1",0xFFB400FF,1265.8516,-885.3967,42.8828+1.0,40.0,0);
printf("%d",variabele);
return 
1;
}
public 
OnGameModeExit()
{
return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
SetPlayerVirtualWorld(playerid,1+playerid);
SetPlayerPos(playerid,1202.3580,-902.9371,48.0625);
SetPlayerCameraPos(playerid,1202.3580,-902.9371,48.0625);
SetPlayerCameraLookAt(playerid,1202.3580,-902.9371,48.0625);
return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
string[100];
    
variabeleempty 100;
    
SendClientMessage(playerid,RED,"When i See Dm with the  Brass knuckles at the spawn youґll get Banned");
    
SendClientMessage(playerid,ORANGE,"Hello this is a testserver");
    
format(string.sizeof(string),"here comes the number %d".,variabeleempty);
    
SendClientMessage(playerid,RED,string);
    return 
1;

Try this


Re: String error /variables help :( - stylerof619 - 06.09.2011

now i get this 1

pawn Код:
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 001: expected token: ",", but found "."
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 029: invalid expression, assumed zero
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : warning 215: expression has no effect
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 001: expected token: ";", but found "sizeof"
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re: String error /variables help :( - =WoR=G4M3Ov3r - 06.09.2011

Quote:
Originally Posted by stylerof619
Посмотреть сообщение
now i get this 1

pawn Код:
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 001: expected token: ",", but found "."
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 029: invalid expression, assumed zero
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : warning 215: expression has no effect
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 001: expected token: ";", but found "sizeof"
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Show me the line thats it giving error in


Re: String error /variables help :( - Kaperstone - 06.09.2011

Quote:
Originally Posted by stylerof619
Посмотреть сообщение
now i get this 1

pawn Код:
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 001: expected token: ",", but found "."
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 029: invalid expression, assumed zero
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : warning 215: expression has no effect
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : error 001: expected token: ";", but found "sizeof"
C:\Users\Dome\Desktop\pawnetc\gamemodes\test.pwn(83) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
show line 83


Re: String error /variables help :( - Vince - 06.09.2011

Press CTRL-G on your keyboard. Type 83 in the box and click Ok. Copy that entire line and paste it here. We're not telepathic and we can't just guess what might be causing the error.

Edit: Fail, beaten two times.


Re: String error /variables help :( - stylerof619 - 06.09.2011

pawn Код:
{
    new string[100];
    variabeleempty = 100;
    SendClientMessage(playerid,RED,"When i See Dm with the  Brass knuckles at the spawn youґll get Banned");
    SendClientMessage(playerid,ORANGE,"Hello this is a testserver");
this is the 83 -- >    format(string.sizeof(string),"here comes the number %d".,variabeleempty);
    SendClientMessage(playerid,RED,string);
    return 1;
}



Re: String error /variables help :( - =WoR=G4M3Ov3r - 06.09.2011

PHP код:
{
    new 
string[100];
    
variabeleempty 100;
    
SendClientMessage(playerid,RED,"When i See Dm with the  Brass knuckles at the spawn youґll get Banned");
    
SendClientMessage(playerid,ORANGE,"Hello this is a testserver");
    
format(stringsizeof(string), "here comes the number %d"variabeleempty);
    
SendClientMessage(playerid,RED,string);
    return 
1;

I had a feeling it was this line, now try this code.


Re: String error /variables help :( - stylerof619 - 06.09.2011

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
EDITING THE CODE

I had a feeling it was this line, now try this code.
Sorry , i did not understood that , i used your code and still got this error


Re: String error /variables help :( - Kaperstone - 06.09.2011

Quote:
Originally Posted by stylerof619
Посмотреть сообщение
pawn Код:
{
    new string[100];
    variabeleempty = 100;
    SendClientMessage(playerid,RED,"When i See Dm with the  Brass knuckles at the spawn youґll get Banned");
    SendClientMessage(playerid,ORANGE,"Hello this is a testserver");
this is the 83 -- >    format(string.sizeof(string),"here comes the number %d".,variabeleempty);
    SendClientMessage(playerid,RED,string);
    return 1;
}
here:
pawn Код:
format(string,sizeof(string),"here comes the number %d",variabeleempty);
replace this with line 83