Pawno Multi Commands
#1

Hi I have Been Haveing Truble With My Script When I whant To Put multi Commands In It Give Me Errors eg.

if (strcmp("/airport", cmdtext, true, 10) == 0)
{
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid, 1986.7913,-2202.7417,13.5469);
return 1;
}
if (strcmp("/help", cmdtext, true 10) == 0)
{
SendPlayerClientMessage(playerid, COLOR_RED, "Just Type /commands or /Telle");
return 1;
}
Then I get This Error......


C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\SF.pwn(149) : error 001: expected token: ",", but found "-integer value-"
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\SF.pwn(149) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\SF.pwn(149) : error 001: expected token: ";", but found ")"
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\SF.pwn(149) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\SF.pwn(149) : fatal error 107: too many error messages on one line


So If You Could Help That Would Be Nice


Thx For Reading This..

Reply
#2

pawn Код:
if (strcmp("/airport", cmdtext, true, 10) == 0)
  {
   SetPlayerInterior(playerid,1);
   SetPlayerPos(playerid, 1986.7913,-2202.7417,13.5469);
   return 1;
  }
  if (strcmp("/help", cmdtext, true 10) == 1)
  {
   SendPlayerClientMessage(playerid, COLOR_RED,"Just Type /commands or /Telle");
   return 1;
  }
try that

EDIT: you posted in wrong topic
Reply
#3

pawn Код:
if (strcmp("/airport", cmdtext, true) == 0)
  {
   SetPlayerInterior(playerid, 1);
   SetPlayerPos(playerid, 1986.7913,-2202.7417,13.5469);
   return 1;
  }
  if (strcmp("/help", cmdtext, true) == 0)
  {
   SendPlayerClientMessage(playerid, COLOR_RED, "Just Type /commands or /Telle");
   return 1;
  }
Reply
#4

This is the short version.
Код:
if(!strcmp("/airport", cmdtext, true))
{
   SetPlayerInterior(playerid, 1);
   SetPlayerPos(playerid, 1986.7913,-2202.7417,13.5469);
   return 1;
}
if(!strcmp("/help", cmdtext, true)) return SendPlayerClientMessage(playerid, COLOR_RED, "Just Type /commands or /Telle");
UPDATED!
Reply
#5

jana4 that won't work, strcmp has to return false..
Reply
#6

Thx that help very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)