invalid expression, assumed zero
#1

Error

PHP Code:
C:\Users\ImAndrew\Desktop\GM Base\gamemodes\TDM.pwn(316) : error 029invalid expressionassumed zero
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Error

Code and line

PHP Code:
public OnPlayerSpawn(playerid)
{
       if (
GetPlayerTeam(playerid) == DRAGONS)
    {
    
SetPlayerPos(playerid318.86391121.69781083.8828);
    
SetPlayerFacingAngle(playerid180.1659);
    
SetPlayerInterior(playerid5);
    
    }
    else
     {
     
    
SetPlayerPos(playerid2264.5317, -1209.79461049.0234);
    
SetPlayerFacingAngle(playerid253.0367);
    
SetPlayerInterior(playerid10);
    
    }
    else 
//line
     
{
     
    
SetPlayerPos(playerid2324.6138, -1143.42071050.4922);
    
SetPlayerFacingAngle(playerid178.6559);
    
SetPlayerInterior(playerid12);
    }
        return 
1;

Reply
#2

You have used "else" twice for the same "if".
Reply
#3

Quote:
Originally Posted by Guscooby
View Post
You have used "else" twice for the same "if".
How do I have to do it then?
Reply
#4

you can do like so:

Code:
if(GetPlayerTeam(playerid) == DRAGONS)
{

}
else if(GetPlayerTeam(playerid) == DINOS)
{

}
else
{

}
Reply
#5

it does not work I select team 3 and I select 2
Reply
#6

Hello!

Do it like this:
PHP Code:
public OnPlayerSpawn(playerid)
{
    if(
GetPlayerTeam(playerid) == DRAGONS)
    {
        
SetPlayerPos(playerid318.86391121.69781083.8828);
        
SetPlayerFacingAngle(playerid180.1659);
        
SetPlayerInterior(playerid5);
    }
    else if(
GetPlayerTeam(playerid) == TEAM2)//edit team2
    
{
        
SetPlayerPos(playerid2264.5317, -1209.79461049.0234);
        
SetPlayerFacingAngle(playerid253.0367);
        
SetPlayerInterior(playerid10);
    }
    else if(
GetPlayerTeam(playerid) == TEAM3)//edit team3
    
{
        
SetPlayerPos(playerid2324.6138, -1143.42071050.4922);
        
SetPlayerFacingAngle(playerid178.6559);
        
SetPlayerInterior(playerid12);
    }
    return 
1;

Please change TEAM2 and TEAM3 in your variables.
Reply
#7

I have this as well but when I select the team members it stays in the RequestClass not spawnee in the position that should

Code
PHP Code:
    AddPlayerClassEx(DRAGONSDragons[random(6)], 318.8639,1121.6978,1083.8828,180.165924,999990,00,0);
    
AddPlayerClassEx(TEMPLARIOTemplarios[random(6)], 2264.5317,-1209.7946,1049.0234,253.036724,999990,00,0);
    
AddPlayerClassEx(MEMBERSMembers[random(6)], 2324.6138,-1143.4207,1050.4922,178.655924,999990,00,0);
public 
OnPlayerSpawn(playerid)
{
    if(
GetPlayerTeam(playerid) == DRAGONS)
    {
        
SetPlayerPos(playerid318.86391121.69781083.8828);
        
SetPlayerFacingAngle(playerid180.1659);
        
SetPlayerInterior(playerid5);
    }
    else if(
GetPlayerTeam(playerid) == TEMPLARIO)//edit team2
    
{
        
SetPlayerPos(playerid2264.5317, -1209.79461049.0234);
        
SetPlayerFacingAngle(playerid253.0367);
        
SetPlayerInterior(playerid10);
    }
    else if(
GetPlayerTeam(playerid) == MEMBERS)//edit team3
    
{
        
SetPlayerPos(playerid2324.6138, -1143.42071050.4922);
        
SetPlayerFacingAngle(playerid178.6559);
        
SetPlayerInterior(playerid12);
    }
    
//more code
OnDialogResponse
    
if(dialogid == DIALOG_TEAMS)
    {
        if(
response)
        {
                 if(
listitem == 0//Dragons
                 
{
                         
SetPlayerTeam(playeridDRAGONS);
                         
SetPlayerColor(playeridCOLOR_DRAGONS);
                         
SpawnPlayer(playerid);
                 }
                 if(
listitem == 1//Templarios
                 
{
                         
SetPlayerTeam(playeridTEMPLARIO);
                          
SetPlayerColor(playeridCOLOR_TEMPLARIOS);
                         
SpawnPlayer(playerid);
                 }
                 if(
listitem == 3//Members
                 
{
                         
SetPlayerTeam(playeridMEMBERS);
                          
SetPlayerColor(playeridCOLOR_MEMBERS);
                         
SpawnPlayer(playerid);
                 }
          }
    } 
also how could I do the following

when a team 1 player for example dies him from a randoms skins
Reply
#8

Show us the OnPlayerRequestClass code, please.
Reply
#9

Yess

PHP Code:
public OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerCameraPos(playerid2697.515869,-11.912069,104.235519);
    
SetPlayerCameraLookAt(playerid2518.345703,20.327928,55.445472);
    
PlayerPlaySound(playerid10530.00.00.0);
    
ShowPlayerDialog(playeridDIALOG_TEAMSDIALOG_STYLE_LIST"Seleccione un equнpo""{77B45A}Of Dragons\n{59BCD6}Templarios\n{3A0009}Members Only""Seleccionar","");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)