Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: heton99 on February 22, 2010, 11:27:43 am

Title: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 11:27:43 am
Hello. I need 2 scripts:
for spawn vehicle and race

first script  spawn pcj600 :)

two script:
I say !race
scripts says:
5
4
3
2
1
Go Go Go!

(sry for me english is very bad :P)


Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 11:57:41 am
mIRC or PAWN server?
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 12:00:12 pm
pawn
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 12:06:46 pm
Put this under OnPlayerText callback:

Code: [Select]
if(strcmp(text,"!pcj",true) == 0)
{
    new Float:x,
          Float:y,
          Float:z,
          Float:angle,
          string[64],
          pveh[MAX_PLAYERS] = 0;

    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,angle);

    pveh[playerid] = CreateVehicle(191,x,y,z,angle,-1,-1);
    PutPlayerInVehicle(playerid,pveh[playerid]);
    SendClientMessage(playerid,0xFFFFFFFF,"Spawned a PCJ-600!");
    return 0;
}

In-game type !pcj.
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 12:12:52 pm
i have error compile:
Code: [Select]
D:\Gta Vice City\gamemodes\stunt.pwn(226) : error 017: undefined symbol "text"
D:\Gta Vice City\gamemodes\stunt.pwn(228) : warning 219: local variable "x" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(229) : warning 219: local variable "y" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(230) : warning 219: local variable "z" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(238) : warning 202: number of arguments does not match definition
D:\Gta Vice City\gamemodes\stunt.pwn(242) : warning 204: symbol is assigned a value that is never used: "string"
Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 12:16:04 pm
Do you have x,y and z defined globally? Just rename the text to cmdtext and you can remove the string[64]. Also, what line exactly gives the "warning 202: number of arguments does not match definition" warning?
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 12:18:12 pm
I do not understand you me english very bad :X
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 12:21:04 pm
Ok, try this:

Code: [Select]
if(strcmp(cmdtext,"!pcj",true) == 0)
{
    new Float:angle;

    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,angle);

    CreateVehicle(191,x,y,z,angle,-1,-1);
    SendClientMessage(playerid,0xFFFFFFFF,"Spawned a PCJ-600!");
    return 0;
}
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 12:21:55 pm
error:
Code: [Select]
D:\Gta Vice City\gamemodes\stunt.pwn(325) : warning 202: number of arguments does not match definition
Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase


1 Warning.

LINE 325
CreateVehicle(191,x,y,z,angle,-1,-1);
Title: Re: I need 2 scripts :)
Post by: Ettans on February 22, 2010, 12:25:20 pm
Not sure what's wrong with it, as the line is ok.
Title: Re: I need 2 scripts :)
Post by: heton99 on February 22, 2010, 12:47:54 pm
:( ok.. who can make 2 script? race
Title: Re: I need 2 scripts :)
Post by: Boss on February 22, 2010, 01:17:11 pm
Please refer to the following resources to learn Pawn scripting:
http://www.compuphase.com/pawn/pawn.htm#DOWNLOAD_DOCS
http://wiki.sa-mp.com/wiki/Category:Scripting_Documentation
http://tdhclan.ru/wiki/index.php/Scripting

If these don't help and you still can't script in Pawn, please hire a scripter to make scripts for you or post a mode request thread instead of requesting each function separately.